Hugh Lauer Xerox Corporation Roger Needham Cambridge University Presented by Vidhya Priyadharshnee Palaniswamy Gnanam Spring 2011.

Slides:



Advertisements
Similar presentations
More on Processes Chapter 3. Process image _the physical representation of a process in the OS _an address space consisting of code, data and stack segments.
Advertisements

Concurrency Important and difficult (Ada slides copied from Ed Schonberg)
Programming Languages Marjan Sirjani 2 2. Language Design Issues Design to Run efficiently : early languages Easy to write correctly : new languages.
Chorus and other Microkernels Presented by: Jonathan Tanner and Brian Doyle Articles By: Jon Udell Peter D. Varhol Dick Pountain.
1 Concurrency: Mutual Exclusion and Synchronization Chapter 5.
Monitors Chapter 7. The semaphore is a low-level primitive because it is unstructured. If we were to build a large system using semaphores alone, the.
Computer Systems/Operating Systems - Class 8
Concurrency, Thread and Event CS6410 Sept 6, 2011 Ji-Yong Shin.
Concurrency: Mutual Exclusion and Synchronization Why we need Mutual Exclusion? Classical examples: Bank Transactions:Read Account (A); Compute A = A +
1 Concurrency: Mutual Exclusion and Synchronization Chapter 5.
1 On the Duality of Operating System Structures by Hugh C. Lauer, Xerox Corporation and Roger M. Needham, Cambridge University Presented by Scott Fletcher.
Concurrency CS 510: Programming Languages David Walker.
Inter Process Communication:  It is an essential aspect of process management. By allowing processes to communicate with each other: 1.We can synchronize.
Concurrency: Mutual Exclusion, Synchronization, Deadlock, and Starvation in Representative Operating Systems.
USER LEVEL INTERPROCESS COMMUNICATION FOR SHARED MEMORY MULTIPROCESSORS Presented by Elakkiya Pandian CS 533 OPERATING SYSTEMS – SPRING 2011 Brian N. Bershad.
“Why Events are a Bad Idea (For high-concurrency servers)” Paper by Rob von Behren, Jeremy Condit and Eric Brewer, May 2003 Presentation by Loren Davis,
1 On the Duality of Operating System Structures Hugh Lauer, Xerox Roger Needham, Cambridge University Oct 1978, reprinted April 1979 Presented by David.
CS533 - Concepts of Operating Systems
On the Duality of Operating System Structures Hugh Lauer Xerox Corporation Roger Needham Cambridge University Presented by Yahia Mahmoud.
Communication in Distributed Systems –Part 2
The Structure of the “THE” -Multiprogramming System Edsger W. Dijkstra Jimmy Pierce.
User-Level Interprocess Communication for Shared Memory Multiprocessors Brian N. Bershad, Thomas E. Anderson, Edward D. Lazowska, and Henry M. Levy Presented.
1 I/O Management in Representative Operating Systems.
PRASHANTHI NARAYAN NETTEM.
1 Threads Chapter 4 Reading: 4.1,4.4, Process Characteristics l Unit of resource ownership - process is allocated: n a virtual address space to.
On the Duality of Operating System Structures Hugh C. Lauer Xerox Corporation Roger M. Needham Cambridge University Presented By: Ashwini Kulkarni.
Chapter 51 Threads Chapter 5. 2 Process Characteristics  Concept of Process has two facets.  A Process is: A Unit of resource ownership:  a virtual.
Experience with Processes and Monitors in Mesa
Inter-Process Communication Mechanisms CSE331 Operating Systems Design.
Dave Archer - CS533 - Spring On the Duality of Operating System Structures Hugh C. Lauer, Roger M. Needham.
On the Duality of Operating System Structures 1. Hugh C. Lauer Xerox Corporation Palo Alto, Californi a Roger M. Needham Cambridge University Cambridge,
- 1 - Embedded Systems - SDL Some general properties of languages 1. Synchronous vs. asynchronous languages Description of several processes in many languages.
CE Operating Systems Lecture 11 Windows – Object manager and process management.
1 Concurrency Architecture Types Tasks Synchronization –Semaphores –Monitors –Message Passing Concurrency in Ada Java Threads.
Ihr Logo Operating Systems Internals & Design Principles Fifth Edition William Stallings Chapter 2 (Part II) Operating System Overview.
CS533 - Concepts of Operating Systems 1 On The Duality of Operating System Structures Hugh Lauer, Xerox Roger Needham, Cambridge University 1979 Presented.
Concurrency: Mutual Exclusion and Synchronization Chapter 5.
Chapter 5 Concurrency: Mutual Exclusion and Synchronization Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee.
ICS 313: Programming Language Theory Chapter 13: Concurrency.
Lecture 8 Page 1 CS 111 Online Other Important Synchronization Primitives Semaphores Mutexes Monitors.
ON THE DUALITY OF OPERATING SYSTEM STRUCTURES Hugh C. Lauer and Roger M. Needham Presented by: Ali R. Butt (adapted from many slides available online and.
Middleware Services. Functions of Middleware Encapsulation Protection Concurrent processing Communication Scheduling.
Chapter 5 Concurrency: Mutual Exclusion and Synchronization Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee.
13-1 Chapter 13 Concurrency Topics Introduction Introduction to Subprogram-Level Concurrency Semaphores Monitors Message Passing Java Threads C# Threads.
CS533 – Spring Jeanie M. Schwenk Experiences and Processes and Monitors with Mesa What is Mesa? “Mesa is a strongly typed, block structured programming.
Lecture 4 Mechanisms & Kernel for NOSs. Mechanisms for Network Operating Systems  Network operating systems provide three basic mechanisms that support.
By: Rob von Behren, Jeremy Condit and Eric Brewer 2003 Presenter: Farnoosh MoshirFatemi Jan
CSE 153 Design of Operating Systems Winter 2015 Midterm Review.
Chapter 5 Concurrency: Mutual Exclusion and Synchronization Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee.
3/12/2013Computer Engg, IIT(BHU)1 OpenMP-1. OpenMP is a portable, multiprocessing API for shared memory computers OpenMP is not a “language” Instead,
REVIEW OF “ON THE DUALITY OF OPERATING SYSTEM STRUCTURES” Paper by Hugh C. Lauer and Roger M. Needham Presentation by Erin Chapman.
Introduction Contain two or more CPU share common memory and peripherals. Provide greater system throughput. Multiple processor executing simultaneous.
Channels. Models for Communications Synchronous communications – E.g. Telephone call Asynchronous communications – E.g. .
Big Picture Lab 4 Operating Systems C Andras Moritz
Chapter 5 Concurrency: Mutual Exclusion and Synchronization Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee.
“Language Mechanism for Synchronization”
On the Duality of Operating System Structures
Concurrency, threads, and events
Outline Other synchronization primitives
Other Important Synchronization Primitives
CS533 Concepts of Operating Systems
MODERN OPERATING SYSTEMS Third Edition ANDREW S
On the Duality of Operating System Structures
Multiple Processor Systems
Threads Chapter 4.
Hugh Lauer Xerox Corporation Roger Needham Cambridge University
Concurrency: Mutual Exclusion and Process Synchronization
CSE 153 Design of Operating Systems Winter 19
On the Duality of Operating System Structures
CS533 Concepts of Operating Systems Class 4
Presentation transcript:

Hugh Lauer Xerox Corporation Roger Needham Cambridge University Presented by Vidhya Priyadharshnee Palaniswamy Gnanam Spring 2011

Key ideas Duality Principle Goals and Approach Message Oriented System Procedure Oriented System Characteristics Duality mapping Similarity of Models Preservation of performance Validation Conclusion References Presented by Vidhya Priyadharshnee Palaniswamy Gnanam Spring 2011

 Two Broad Categories of OS ◦ Message-oriented System ◦ Procedure-oriented System  Most systems biased toward one of these  Both have different kinds of primitive operations for managing processes and synchronization.  No real operating system exactly fits either model in all respects.  Many operating systems have some subsystems that fit one model, and others that fit the other. Presented by Vidhya Priyadharshnee Palaniswamy Gnanam Spring 2011

 Multiple Processes needs to perform operations on a single data o Data may segregated and be specific to a process (message oriented) o Data is shared in the common address space shared by all processes (procedure oriented in kernel space)  Need to avoid race condition allow process synchronization  At the time of paper, there were two camps arguing which is best- message oriented/ procedure oriented  The paper proposes both are equivalent and dual to each other Presented by Vidhya Priyadharshnee Palaniswamy Gnanam Spring 2011

 When values and operations can be paired up in a way that leaves everything important unchanged when all pairs are switched simultaneously, we call the members of each pair dual to each other.  The primitive operations of message oriented and procedure oriented systems can be swapped simultaneously preserving the logic and performance of a program. Presented by Vidhya Priyadharshnee Palaniswamy Gnanam Spring 2011

To demonstrate that These two categories are duals of each other- Constructs have direct counterparts The dual programs are logically identical to each other Performance is identical in both systems given identical scheduling strategies Neither system is inherently better than the other Choice of model is based on constraints imposed by machine architecture and hardware Empirical approach Observation,classification of properties, generalization and construction of abstract models Informal reasoning, empirical support Conclusion about the class of objects Presented by Vidhya Priyadharshnee Palaniswamy Gnanam Spring 2011

 Small number of, static big processes, often no sharing of address spaces -data references passed in messages  Process Declaration consists of Local data and algorithms, Message ports, Message channels for other processes.  Explicit messages for communication o Destination (Message Channels) o Queuing messages at destination processes (Message Ports)  Primitive operations for message transmission SendMessage, AwaitReply, WaitForMessage, SendReply Presented by Vidhya Priyadharshnee Palaniswamy Gnanam Spring 2011

 Specific communication paths  Static number of processes and the connections between them - Deletion, creation and changing connections of processes difficult because of queuing.  Process tends to operate in a relatively static context. Processes rarely share data in memory.  Similar to event handling mechanism: where events are handled synchronous with the program flow. Presented by Vidhya Priyadharshnee Palaniswamy Gnanam Spring 2011

 Synchronization achieved by o Processes queues for congested resources in message queues attached to the processes associated with those resources. o Process access data only when it is processing a message referring to it. Does not manipulate it after it is passed on in a message to another process.  Control of peripheral devices by sending messages  Priorities are statically assigned Presented by Vidhya Priyadharshnee Palaniswamy Gnanam Spring 2011

Message oriented system Presented by Vidhya Priyadharshnee Palaniswamy Gnanam Spring 2011

Process 3 Process 2 Process 4 Process 1 Data Presented by Vidhya Priyadharshnee Palaniswamy Gnanam Spring 2011

Process 3 Process 2 Process 4 Process 1 Data Message port1 Message port2 Message port3 Processes have message ports to receive messages in queue Presented by Vidhya Priyadharshnee Palaniswamy Gnanam Spring 2011

Process 3 Process 2 Process 4 Process 1 Data Each process has its own data. A process operates on data contained by another process by means of explicit message passing mechanism Presented by Vidhya Priyadharshnee Palaniswamy Gnanam Spring 2011

Process 3 Process 2 Process 4 Process 1 Data Wait for Message() The process containing the data receives request in the form of message. All processes waits for Requests from other Processes in all its ports. Presented by Vidhya Priyadharshnee Palaniswamy Gnanam Spring 2011

Process 3 Process 2 Process 4 Process 1 Data SendMessage() Process 3 sends Request for Process 1 Data. The request is Queued in the message Port of process1 Presented by Vidhya Priyadharshnee Palaniswamy Gnanam Spring 2011

Process 3 Process 2 Process 4 Process 1 Data SendReply() AwaitReply() The data is operated by the algorithm defined for that port which received the message Result is sent back The requesting process can either block (synchronous)/ resume its operation (asynchronous) Presented by Vidhya Priyadharshnee Palaniswamy Gnanam Spring 2011

Process 3 Process 2 Process 4 Process 1 Data Process 1 processes next message in the queue Similar to Event handler mechanism All process processes only one message at a time. Thus synchronization is achieved!. Presented by Vidhya Priyadharshnee Palaniswamy Gnanam Spring 2011

 Procedure o Contains Algorithms, local data, parameters, results  Procedure call o Synchronous: the calling procedure blocks until the called procedure returns o Asynchronous: the calling procedure continues execution along with the called procedure  fork procedureName(parameterList) Returns processID  join processID Returns (resultsList) Presented by Vidhya Priyadharshnee Palaniswamy Gnanam Spring 2011

 Characterized by a protection and addressing mechanism for procedure call facility  Large number of small processes (threads), easy creation and deletion of processes as there are no communication channels.  Communication by means of direct sharing and locking of data. Little or no direct communication.  Similar to multithreaded environment- processes share memory in kernel space Presented by Vidhya Priyadharshnee Palaniswamy Gnanam Spring 2011

 Process Synchronization achieved by locks, semaphores or monitors. Congested resources result in processes blocking while waiting on monitor locks or condition variables  Data is shared between processes  Peripherals are controlled by locks and shared memory  Processes have dynamic priorities  Global naming scheme often used Presented by Vidhya Priyadharshnee Palaniswamy Gnanam Spring 2011

 Module is primitive unit of compilation containing Procedures and Data  A monitor is a special kind of module that has private data and procedures, protected with a lock.  Processes must acquire the lock when they call an entry procedure (a procedures which can be called from outside the monitor).  Only one process can operate inside the monitor at a time.  Can be instantiated using NEW and START statements. Presented by Vidhya Priyadharshnee Palaniswamy Gnanam Spring 2011

 Provides flexible synchronization among events than mutual exclusion  Has associated with it a queue of processes  Two operations: ◦ wait conditionVariable ◦ signal conditionVariable Presented by Vidhya Priyadharshnee Palaniswamy Gnanam Spring 2011

Procedure oriented system Presented by Vidhya Priyadharshnee Palaniswamy Gnanam Spring 2011

 Monitor has global data representing the state information for the resource  Number of procedure declarations representing the different services offered.  Attribute ENTRY used to seizing the monitor lock  Only means of interaction among its components is procedural Presented by Vidhya Priyadharshnee Palaniswamy Gnanam Spring 2011

Global Data Condition Variable Monitor NEW/ START Global Data is shared across multiple processes Monitor encapsulates the data and methods and provides synchronized data access Proce ss1 Proce ss2 Proce ss3 Presented by Vidhya Priyadharshnee Palaniswamy Gnanam Spring 2011

Global Data Condition Variable Monitor NEW/ START Proce ss1 Proce ss2 Proce ss3 A process should first acquire mutex for data, and then perform its operations. Procedure CALL Locked by proc 1 Any other process requesting for mutex is queued. No other process is allowed to access the data if its locked Procedure can wait (synchronous) Or proceed with its operations (asynchronous) Presented by Vidhya Priyadharshnee Palaniswamy Gnanam Spring 2011

Global Data Condition Variable Monitor NEW/ START Proce ss1 Proce ss2 Proce ss3 Procedure CALL Algorithm for Procedure 1 if Resource Exhausted then WAIT C the process waits until some other process SIGNAL C Procedure 1 wakes up when data Is ready and Finishes Presented by Vidhya Priyadharshnee Palaniswamy Gnanam Spring 2011

Global Data Condition Variable Monitor NEW/ START Proce ss1 Proce ss2 Proce ss3 Process 1 releases the mutex Unlocked by proc 1 Next process in the queue is scheduled. The data is operated by one process at a time Thus Synchronization is achieved! Presented by Vidhya Priyadharshnee Palaniswamy Gnanam Spring 2011

Of both Systems Presented by Vidhya Priyadharshnee Palaniswamy Gnanam Spring 2011

Message-oriented Process, CreateProcess Message channels/ports SendMessage/AwaitReply (immediate) SendMessage/AwaitReply (delayed) SendReply Main loop of standard resource manager, WaitFor Message statement, case statement Arms of the case statement Waiting for messages Procedure-oriented Monitors, NEW/START External Procedure identifiers ENTRY Procedure call FORK/JOIN RETURN (from procedure) monitor Lock, ENTRY attribute ENTRY procedure declarations Condition variables, WAIT, SIGNAL Presented by Vidhya Priyadharshnee Palaniswamy Gnanam Spring 2011

Process, CreateProcess Monitors, NEW/START External Message channels/ports Procedure identifiers ENTRY SendMessage/AwaitReply (immediate) Procedure call SendMessage/AwaitReply (delayed) FORK/JOIN SendReply RETURN (from procedure) Presented by Vidhya Priyadharshnee Palaniswamy Gnanam Spring 2011

Main loop WaitFor Message statement, case statement Lock, ENTRY attribute Arms of the case statement (which port) ENTRY procedure declarations (which procedure) Waiting for messages WAIT, SIGNAL Presented by Vidhya Priyadharshnee Palaniswamy Gnanam Spring 2011

 A system constructed with the primitives defined by one model can be mapped directly into a dual system, which fits the other model.  A client program written for one system can be transformed for the other system by replacing the primitives from the first model with the primitives of the other.  Logic of program not affected by transformation ◦ None of the important parts are touched or rearranged ◦ The semantic component is invariant ◦ Only the syntax of primitives varies Presented by Vidhya Priyadharshnee Palaniswamy Gnanam Spring 2011

Three important elements that affect performance  Execution time  Computational load  Queuing and Wait times The duality mapping doesn’t modify the main bodies of the programs  Speed of execution of a single program is same  Number of additions, multiplications, comparisons are same  So the amount of computing power is same  In a suite, the way in which the executions of those programs interact with others is same  Process wait time is same  Life time of computation is same Presented by Vidhya Priyadharshnee Palaniswamy Gnanam Spring 2011

 No formal proof  Mixed acceptance among a (biased) peer community  Only one citable case: Cambridge CAP computer ◦ Originally message-oriented ◦ Switched to process-oriented, with little change  No attempt is made to rigorously prove their assertions Presented by Vidhya Priyadharshnee Palaniswamy Gnanam Spring 2011

 No inherent differences between the models  Choose model based on ◦ Machine architecture ◦ Programming environment  Both systems has its own merits, and it cannot be said one is better than the other.  Eliminates some degrees of freedom in the design process This property of equivalence between two categories of operating system can be used in effective implementation of OS on a particular architecture based on performance calculation beforehand. Presented by Vidhya Priyadharshnee Palaniswamy Gnanam Spring 2011

 Hugh C. Lauer, Roger M. Needham. “On the Duality of Operating System Structures.” in Proceedings of the Second International Symposium on Operating Systems, IRIA, October 1978, reprinted in Operating Systems Review, 13, 2, pp April  Thanks to Elizabeth Keniston CS Winter2009      areTask.pdf areTask.pdf    #Duality_principle #Duality_principle Presented by Vidhya Priyadharshnee Palaniswamy Gnanam Spring 2011