Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 On the Duality of Operating System Structures by Hugh C. Lauer, Xerox Corporation and Roger M. Needham, Cambridge University Presented by Scott Fletcher.

Similar presentations


Presentation on theme: "1 On the Duality of Operating System Structures by Hugh C. Lauer, Xerox Corporation and Roger M. Needham, Cambridge University Presented by Scott Fletcher."— Presentation transcript:

1 1 On the Duality of Operating System Structures by Hugh C. Lauer, Xerox Corporation and Roger M. Needham, Cambridge University Presented by Scott Fletcher

2 2 Authors’ Claim Most operating systems (or subsystems) can be classified into one of two models –Message-Oriented –Procedure-Oriented These two models represent a duality –Identical in logic and performance The argument should not be which model is “better”, but which model is “better suited” to the machine architecture upon which the system is being built

3 3 Message-Oriented Systems Small, static process count Explicit messages for communication –Passing (Message Channels) –Queuing (Message Ports) –Waiting for Data (MsgWait) Persistent Bindings –complexity in creating processes Primitive Message Transmission Operations: –Send –Wait (WaitForMessage) –SendReply –AwaitReply Preemption driven by message arrival –When a higher priority process is waiting Little to no sharing of address spaces –Data or pointers passed in messages Producer Consumer Send Wait AwaitReply SendReply Channel Ports Execution “Stream” Data “Stream”

4 4 Message-Oriented Systems Summary: –The number of processes and the connections between them are relatively static –Specific communications are established between particular pairs of processes –Messages are passed between processes –Processes rarely share data in memory

5 5 Procedure-Oriented System Characterized by: –A protection and addressing mechanism oriented toward procedures –Procedure call facilities which can rapidly take a process from one context to another –Cooperation among processes is achieved by some form of locks, semaphores, monitors, or other synchronizing data structures

6 6 Procedure-Oriented System Large, dynamic process count Shared data system for communication –Passing (Variables) –Queuing (Monitors) –Waiting for Data (Condition Variables) Persistent State –Complexity in creating shared data Primitive Operations –Wait –Signal –Fork –Join Preemption driven by release of lock –When a higher priority process is waiting Little or no messaging –Data or pointers passed in shared variables Producer Consumer Signal Wait

7 7 Procedure-Oriented System Summary: –Creating processes is easy as no communication channels have to be set up between them –Global/shared data is protected and accessed through locking mechanisms and synchronization –A process typically has only one goal or task, and it wanders throughout the system in order to get that thing done

8 8 Characteristics of the Models The two styles of system design are a duality –Def: A duality translates concepts, theorems, or mathematical structures into other concepts, theorems or structures in a one-to-one fashion –A program for one kind of system can be mapped into a program appropriate for the other –As a result of this mapping, the logic of the programs in the dual systems is invariant –The performance of the system can be preserved across the mapping

9 9 The Duality Mapping Message-oriented systemProcedure-oriented system Processes, CreateProcessMonitors, NEW/START External Message Channels MessageProcedure identifiers ENTRY PortsProcedure identifiers simple SendMessage; AwaitReply (immediate)Procedure call SendMessage;... AwaitReply (delayed)FORK;...JOIN SendReplyRETURN (from procedure) monitor main loop of standard resource manager, WaitForMessage statement, case statement Lock, ENTRY attribute Arms of the case statement selectiveENTRY procedure declarations Waiting for messagesCondition Variables, WAIT, SIGNAL

10 10 The Duality Mapping Producer Consumer  - dual operations   Signal Wait Send Wait WaitReply SendReply         Channel Ports Execution “Stream” Data “Stream” Execution “Stream” Data “Stream”

11 11 Similarity of Programs The system, or subsystem, of one style can be transformed directly into the other by replacing each construct with its corresponding construct The transformation does not affect the logic of the client programs: –no algorithms are changed –no data structures are replaced –no interface strategies are affected

12 12 Preservation of Performance The dynamic behavior of a system of programs has three components: –The execution times of the programs themselves –The computational overhead of the primitive system operations they call –The queuing and waiting times which reflect the congestion and sharing of resources, dependence upon external events, and scheduling decisions

13 13 Preservation of Performance Execution Time The duality transformation leaves the main bodies of the programs untouched: –The algorithms will compute at the same speed –The same amount of information will be stored in each data structure –The same amount of client code will be executed in each of the systems –The same number of additions, multiplications, comparisons, and string operations will be performed

14 14 Preservation of Performance Computational Overhead The facilities of each of the two canonical models can be made to execute as efficiently as the corresponding facilities of the other model: –Sending a message has the same computational complexity as that of calling or FORKING to an ENTRY procedure –Leaving a monitor has the same complexity as that of waiting for new messages –Process switching can be made equally fast in either system, and for similar machine architectures this means saving the same amount of state information –Virtual memory and paging or swapping can be used with equal effectiveness in either model

15 15 Preservation of Performance Queuing and Waiting Times The basic operations of the two models can also be made to behave identically with respect to the scheduling and dispatching of client processes (corresponding events will happen in the same order): –If the message has to be queued at the destination process, then the procedure call will also be queued at its monitor, WAIT statement, or JOIN statement (for the same length of time) –The peripheral devices will exhibit the same behavior with respect to latency, response time, and transfer times –The scheduling and dispatching can be arranged so that the same number of context switches and allocations of message blocks take place whether it is a message-oriented or a procedure-oriented system

16 16 Underlying Differences There is no inherent difference between the two styles of system design or the programs that use them –0 th order = similar program structure and performance –1 st order = similar computational complexity –Preferring one style over another = 2 nd order or higher

17 17 Final Arguments Neither model is “better” than the other Both strategies can be built to provide identical performance, logical soundness, elegance, and correctness Deciding to use one strategy over the other will NOT introduce any fundamental incompatibilities As both styles are duals in regards to the most important considerations for designing an OS, the design selected should be based, first and foremost, on the machine architecture upon which the system is being built

18 18 Thanks Thanks to Dave Archer and his slides from Spring ‘06 for providing some nice graphics Thanks for listening


Download ppt "1 On the Duality of Operating System Structures by Hugh C. Lauer, Xerox Corporation and Roger M. Needham, Cambridge University Presented by Scott Fletcher."

Similar presentations


Ads by Google