Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
On The Duality of Operating System Structures Hugh Lauer, Xerox Roger Needham, Cambridge University 1979 Presented by Catherine Vilhauer CS533 - Concepts of Operating Systems 1 Introduction Classic paper by Lauer and Needham(1979) Operating Systems fall into two categories o o These two systems are duals o o o Message-oriented systems Procedure-oriented systems can be mapped to one another are logically identical performance is also identical As a result, which you choose based on architecture constraints CS533 - Concepts of Operating Systems 2 What I’m Going to Cover Message-Oriented System Procedure-Oriented System Comparison of the Two Argument for Duality Evidence? CS533 - Concepts of Operating Systems 3 Message-Oriented Systems What are they? Pass messages (or events) easily and efficiently among processes Queue messages at destination process Primitive operations for processes Pre-emption occurs when higher priority message received CS533 - Concepts of Operating Systems 4 Message-Oriented System What’s a good design? Specific communication paths (message channels, sockets etc) Relatively static number of processes and connections o Relatively static context for each process o o Deletion and creation of processes can be difficult virtual memories or address spaces in one-to-one correspondence with process. Processes rarely share data in memory Processes tend to be associated with system resources CS533 - Concepts of Operating Systems 5 Message-Oriented Systems Characteristics Synchronization implemented in message queues Data structures passed by reference in messages Peripheral devices treated as processes Priorities statically assigned at time of design Processes operate on small number of messages at a time and complete those operations before looking at message queue again Procedural interfaces or global naming schemes not useful CS533 - Concepts of Operating Systems 6 Message-Oriented Systems Canonical Model Idealized Operating System kernel contains: o o o Messages and message identifiers Message channels and Message Ports Four message transmission operations • • • • o o SendMessage(MessageChannel, MessageBody) AwaitReply(MessageID) WaitForMessage(set of MessagePorts) SendReply(MsgId, MsgBody) Process Declarations Create Process CS533 - Concepts of Operating Systems 7 An Example: SEDA Message-Oriented System SEDA Message Queues YES – each stage has a message queue Data structures passed by reference YES Peripheral Devices treated as processes YES Processes that complete operation before looking at message queue No procedural interfaces YES – A SEDA stage operates like this YES CS533 - Concepts of Operating Systems 8 Procedure-Oriented Systems What are they? Oriented around procedure Efficient context switching Synchronization via locks, mutexes and semaphores Process may have to wait for a lock Preemption occurs when release performed on a lock CS533 - Concepts of Operating Systems 9 Procedure-Oriented Systems What’s a good design? Global data protected and accessed by procedural interfaces which do synchronization in controlled ways Process creation and deletion easy Process has just one task, but wanders over system Encoded in common / global data structures CS533 - Concepts of Operating Systems 10 Procedure-Oriented Systems Characteristics Synchronization - queues of processes waiting for locks Data shared directly among processes Control of and interrupts from devices manipulating locks and / or shared data in memory Processes inherit priorities dynamically Global naming schemes CS533 - Concepts of Operating Systems 11 Procedure-Oriented System Canonical Model Idealized Operating System contains: o Procedures • • • • o Procedure call facilities • • o o o local data algorithms parameters results synchronous asynchronous Modules and monitors Condition Variables Fork and Join CS533 - Concepts of Operating Systems 12 Comparison of the Two Systems Synchronization Shared Data Peripheral Devices Priorities Global Naming Schemes Message-Oriented System Message queues Procedure-Oriented System Not useful Useful Queues of processes waiting for locks Data structures passed Data shared dirctly among by reference in msgs processes Treated as processes Control of and interrupts from devices - manipulating locks / shared data in memory Statically assigned Dynamically assigned CS533 - Concepts of Operating Systems 13 An Example: KNOT Knot platform built by Behren, Condit and Brewer in following paper Interesting that Brewer was co-author of SEDA paper arguing for event-based system 2 years before CS533 - Concepts of Operating Systems 14 The Duality Mapping Message-Oriented System Procedure-Oriented System Processes, CreateProcess Monitors, NEW/START External Message Channels Message Procedure identifiers ENTRY Ports Procedure identifiers simple SendMessage; AwaitReply (immediate) Procedure Call SendMessage; AwaitReply (delayed) FORK / JOIN Main loop of resource manager, WaitForMessage, case statement Arms of the case statement selective Lock, ENTRY attribute ENTRY procedure declarations Waiting for messages Condition variables, WAIT, SIGNAL CS533 - Concepts of Operating Systems 15 The Duality Argument Similarity of Programs Can transform one system to the other o If written in exact style shown on previous slide Logic unchanged Monitor Procedure Calls Process declaration SendMessage AwaitReply CS533 - Concepts of Operating Systems 16 The Duality Argument Performance is Preserved Performance of both systems the same o Execution time of program themselves • o computational overhead of primitive operations they call • • o But since we have already shown that the programs are identical, then the execution time of each system will be exactly the same too. The authors assert that the two canonical models can be made execute as efficiently as the other GEC 4080 and MESA - different systems, but same speed queuing and waiting times (sharing resources) • • can make basi operations of the two models behave identically with scheduling operations. Will happen just as quickly and in the same order in both CS533 - Concepts of Operating Systems 17 Evidence? Not much empirical evidence Cambridge CAP Computer Hugely influential and still considered a classic CS533 - Concepts of Operating Systems 18 Conclusions No inherent different between the two styles Produce systems of similar structure and performance Computational complexity is similar Why choose one over the other? o o Machine architecture Programming environment CS533 - Concepts of Operating Systems 19