On the Duality of Operating System Structures -- Lauer and Needham ------------------------------------------------------------------ Summary: OSes can be message-oriented or procedure-oriented, but these two models are duals of each other. Neither model is inherently preferable, and machine architecture is the main consideration when choosing between them, not the applications on the OS. Author's observation: OSes are biased towards being message-oriented or procedure-oriented. Efforts to combine both the models in a single OS have not been successful. Canonical Models: - message-oriented: small and relatively static number of big processes, with explicit set of message channels between them, limited amount of direct sharing of data, and a separate address space for each process. eg., real-time systems, IBM OS/360, GEC4080. Synchronization at the message queues, shared data by passing references in messages, and static priorities. Facilities provided: messages, message ids, message channels and ports, processes; - procedure-oriented: large number of very small processes which are rapidly created and deleted, with communication by direct memory sharing, and each process being identified with a function (no separate address space) The two models are duals of each other, with the dual systems being very similar to each other in logic, appearance, and performance. This implies that the choice of the model is dependent on the underlying architecture and not the apps. The Duality Relations: Message-Oriented Procedure-Oriented ---------------- ------------------ Processes, CreateProcess Monitors, NEW/START Message Channels External Procedure Identifiers Message Ports ENTRY Procedure Identifiers SendMessage; ... AwaitReply simple procedure call (immediate) SendMessage; ... AwaitReply FORK; ...JOIN (delayed) SendReply RETURN (from procedure call) main loop of standard resource monitor lock, ENTRY attribute manager, WaitForMessage statement, case statement arms of the case statement ENTRY procedure declarations selective waiting for messages condition variables, WAIT, SIGNAL Using the above transformations, programs written in one model can be directly transformed into the other model. This does not involve any change in the semantic content or logic and is equivalent to just changing the keywords in the language. Performance of both the models (for reasonable implementations) is comparable. Hence no inherent difference in the two styles; similar program structure and performance ("zeroth-order" consideration), and similar computational complexity ("first-order" consideration); the authors opine that higher-order considerations such as nature of substrate (machine architecture or programming environment) might be the basis of choice among the models.