210 likes | 220 Views
This paper explores the concepts of duality in operating system structures, specifically the relationship between message-oriented and procedure-oriented models. It discusses the implications and similarities in program execution and performance.
E N D
CS533 Concepts of Operating SystemsOn the Duality of Operating System Structures Hugh Lauer Xerox Corporation Roger Needham Cambridge University Presented by Thanh Dang Acknowledgements: Yahia Mahmoud, Jonathan Walpole
What the paper is about? CS533 - Concepts of Operating Systems
Outlines • Concepts • Duality: What “=“ means? • Operating System Structures • Messasge-oriented vs. procedure-oriented • Observations on duality • Duality mapping • Logically identical • Identical performance • Implications • Comments CS533 - Concepts of Operating Systems
Concepts • Duality (Optimization): The solution of one is also the solution of another. • Two systems are dual if they • From outside • Are logically identical to each other • Have identical performance. • From inside • Have primitives defined by one can be mapped directly into the other • Have Primitive operations of one are as efficient as the other CS533 - Concepts of Operating Systems
Are operating systems dual? CS533 - Concepts of Operating Systems
Models of operating systems • How do processes communicate and synchronize? • Message passing : Message-oriented model • Small number of big processes • Explicit message channels • Identification of the context of execution with processes • Shared memory : Procedure-oriented system • Large number of small processes • Direct sharing and interlocking of data • Identification of the context of execution with functions CS533 - Concepts of Operating Systems
Message-oriented system • Synchronization: Message queue • Data passed by reference • Peripheral devices are processes • Static context, no global naming • Process creation and deletion are difficult CS533 - Concepts of Operating Systems
Message-oriented model CS533 - Concepts of Operating Systems
Message-oriented model CS533 - Concepts of Operating Systems
Message-oriented model • Messages, message identifiers • Message channels, message ports • SendMessage[ messageChannel, messageBody ] • returns[ messageId ] • AwaitReply[ messageId ] returns [ messageBody ] • WaitForMessage[ set of messagePort ] returns [ messageBody, messageld, messagePort ] • SendReply[ messageId, messageBody ] • Process declaration • CreateProcess CS533 - Concepts of Operating Systems
Procedure-oriented system • Synchronization: process waiting for lock • Data shared among processes • “interrupts” from peripheral devices – locks or shared data • Global naming • Process creation and deletion are cheap CS533 - Concepts of Operating Systems
Procedure-oriented model CS533 - Concepts of Operating Systems
Procedure-oriented model CS533 - Concepts of Operating Systems
Procedure-oriented model • Procedures, process identifiers • Procedure call facilities, synchronous and asynchronous • processld <- FORK procedureName[ parameterList ] • [ resultList ] <- JOIN processld • Modules and monitors • Module instantiation with NEW and START • Condition variables • WAIT conditionVariable • SIGNAL condition Variable CS533 - Concepts of Operating Systems
Concepts • Duality: The solution of one is also the solution of another. • Two systems are duality if • From outside • Logically identical to each other • Identical performance. • From inside • Primitives defined by one can be mapped directly into the other one • Primitive operations of one is as efficient as the dual model. CS533 - Concepts of Operating Systems
Observation 1: Duality Mapping • Message-oriented system • Procedure-oriented system Processes, CreateProcess message channels message message ports SendMessage; AwaitReply (immediate) SendMessage;... AwaitReply (delayed) SendReply main message loop arms of the case statement selective waiting for messages monitors, NEW/START External procedure identifiers ENTRY procedure identifiers simple procedure call FORK; . . .JOIN RETURN (from procedure) monitor lock, ENTRY attribute ENTRY procedure declarations condition variables, WAIT, SIGNAL CS533 - Concepts of Operating Systems
Observation 2: Logically identical • Control structures are directly translated • No algorithms are changed • No data structures are replaced • Semantic content is invariant • Logic of the program is preserved CS533 - Concepts of Operating Systems
Observation 3: Identical performance • Performance P = E + S + Q • E: Execution time of the program • Same data structure, same operations • S: System call overhead • Method calls = message sends • Process switching can be equally fast • Virtual memory and paging can be equally fast • Q: Queuing and waiting time • Message queuing = lock queuing CS533 - Concepts of Operating Systems
Outlines • Concepts • Duality: What “=“ means? • Operating System Structures • Messasge-oriented vs. procedure-oriented • Duality • Program Similarity • Performance • Implications • Comments CS533 - Concepts of Operating Systems
Implications • No model is inherently preferable • Choosing one or another depends on • Machine structure • Not application CS533 - Concepts of Operating Systems
Other comments • Empirical analysis but refer to only a few practical operating systems • Informal arguments, not sure if formal and rigorous proof is possible • A mechanism which has no dual: Good or Bad? • Unclear if it is still true when we have a zoo of operating systems nowadays – empirical data is different. Has time already proved if they are correct? CS533 - Concepts of Operating Systems