Asynchronous Message Passing EE 524/CS 561 Wanliang Ma 03/08/2000.

Slides:



Advertisements
Similar presentations
©2009 Operačné systémy Procesy. 3.2 ©2009 Operačné systémy Process in Memory.
Advertisements

1 Concurrency: Mutual Exclusion and Synchronization Chapter 5.
Abhinav Kamra Computer Science, Columbia University 4.1 Operating System Concepts Silberschatz, Galvin and Gagne  2002 Chapter 4: Processes Process Concept.
Informationsteknologi Wednesday, September 26, 2007 Computer Systems/Operating Systems - Class 91 Today’s class Mutual exclusion and synchronization 
1 Concurrency: Mutual Exclusion and Synchronization Chapter 5.
Introduction in algorithms and applications Introduction in algorithms and applications Parallel machines and architectures Parallel machines and architectures.
Adapted from slides ©2005 Silberschatz, Galvin, and Gagne Lecture 4: Processes.
Chapter 3: Processes.
Remote Procedure Call in SR Programming Language By Tze-Kin Tsang 3/20/2000.
1 Semaphores Special variable called a semaphore is used for signaling If a process is waiting for a signal, it is suspended until that signal is sent.
Operating System Concepts with Java – 7 th Edition, Nov 15, 2006 Silberschatz, Galvin and Gagne ©2007 Chapter 3: Processes.
Concurrency CS 510: Programming Languages David Walker.
Chapter 3: Processes. 3.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts - 7 th Edition, Feb 7, 2006 Chapter 3: Processes Process Concept.
1/30/2004CSCI 315 Operating Systems Design1 Processes Notice: The slides for this lecture have been largely based on those accompanying the textbook Operating.
Chapter 3: Processes. Process Concept Process Scheduling Operations on Processes Cooperating Processes Interprocess Communication Communication in Client-Server.
02/02/2004CSCI 315 Operating Systems Design1 Interprocesses Communication Notice: The slides for this lecture have been largely based on those accompanying.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 4: Processes Process Concept Process Scheduling Operations on Processes Cooperating.
Chapter 3: Processes. 3.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts - 7 th Edition, Feb 7, 2006 Chapter 3: Processes Process Concept.
02/01/2010CSCI 315 Operating Systems Design1 Interprocess Communication Notice: The slides for this lecture have been largely based on those accompanying.
CS603 Communication Mechanisms 14 January Types of Communication Shared Memory Message Passing Stream-oriented Communications Remote Procedure Call.
Interprocess Communication. Process Concepts Last class.
Lecture 4: Parallel Programming Models. Parallel Programming Models Parallel Programming Models: Data parallelism / Task parallelism Explicit parallelism.
Chapter 9 Message Passing Copyright © Operating Systems, by Dhananjay Dhamdhere Copyright © Operating Systems, by Dhananjay Dhamdhere2 Introduction.
Chap 3 Processes-Concept. Process Concept Process – a program in execution; process execution must progress in sequential fashion A process includes:
Process Concept Process Scheduling Operations on Processes Cooperating Processes Interprocess Communication Communication in Client-Server Systems.
1 Chapter 2. Communication. STEM-PNU 2 Layered Protocol TCP/IP : de facto standard Our Major Concern Not always 7-layered Protocol But some other protocols.
Concurrency: Mutual Exclusion and Synchronization Chapter 5.
- 1 - Embedded Systems - SDL Some general properties of languages 1. Synchronous vs. asynchronous languages Description of several processes in many languages.
1 Concurrency Architecture Types Tasks Synchronization –Semaphores –Monitors –Message Passing Concurrency in Ada Java Threads.
1 Lecture 5 (part2) : “Interprocess communication” n reasons for process cooperation n types of message passing n direct and indirect message passing n.
AE4B33OSS Chapter 3: Processes. 3.2Silberschatz, Galvin and Gagne ©2005AE4B33OSS Chapter 3: Processes Process Concept Process Scheduling Operations on.
Chapter 3: Processes. 3.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts - 7 th Edition, Feb 7, 2006 Outline n Process Concept n Process.
Chapter 3: Processes (6 th edition chap 4). 3.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 3: Processes Process Concept Process.
Chapter 3: Processes. 3.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 3: Processes Process Concept Process Scheduling Operations.
Chapter 3: Processes. 3.2CSCI 380 Chapter 3: Processes Process Concept Process Scheduling Operations on Processes Cooperating Processes Interprocess Communication.
1 11/1/2015 Chapter 4: Processes l Process Concept l Process Scheduling l Operations on Processes l Cooperating Processes l Interprocess Communication.
Processes. Chapter 3: Processes Process Concept Process Scheduling Operations on Processes Cooperating Processes Interprocess Communication Communication.
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.
CS212: OPERATING SYSTEM Lecture 2: Process 1. Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 3: Process-Concept.
Synchronization Methods in Message Passing Model.
Chapter 3: Processes. 3.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 3: Processes Process Concept Process Scheduling Operations.
Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Technology Education Lecture 3 Operating Systems.
Chapter 3: Process-Concept. Process Concept Process Scheduling Operations on Processes Cooperating Processes Interprocess Communication Communication.
Distributed Programming Concepts and Notations. Inter-process Communication Synchronous Messages Asynchronous Messages Select statement Remote procedure.
Chapter 5 Concurrency: Mutual Exclusion and Synchronization Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee.
Chapter 3: Processes. 3.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts - 7 th Edition, Jan 19, 2005 Chapter 3: Processes Process Concept.
Chapter 3: Processes-Concept. 3.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 3: Processes-Concept Overview Process Scheduling.
13-1 Chapter 13 Concurrency Topics Introduction Introduction to Subprogram-Level Concurrency Semaphores Monitors Message Passing Java Threads C# Threads.
Chapter 5 Concurrency: Mutual Exclusion and Synchronization Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee.
 Process Concept  Process Scheduling  Operations on Processes  Cooperating Processes  Interprocess Communication  Communication in Client-Server.
Chapter 3: Processes. 3.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 3: Processes Process Concept Process Scheduling Operations.
Concurrent Object-Oriented Programming Languages Chris Tomlinson Mark Scheevel.
1 Chapter 2. Communication. STEMPusan National University STEM-PNU 2 Layered Protocol TCP/IP : de facto standard Our Major Concern Not always 7-layered.
Chapter 3: Process-Concept. 3.2 Silberschatz, Galvin and Gagne ©2005 Operating System Principles Chapter 3: Process-Concept Process Concept Process Scheduling.
Channels. Models for Communications Synchronous communications – E.g. Telephone call Asynchronous communications – E.g. .
Chapter 3: Processes. 3.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts - 7 th Edition, Feb 7, 2006 Chapter 3: Processes Process Concept.
Message passing model. buffer producerconsumer PRODUCER-CONSUMER PROBLEM.
Chapter 5 Concurrency: Mutual Exclusion and Synchronization Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee.
Chapter 3: Process Concept
“Language Mechanism for Synchronization”
Processes Overview: Process Concept Process Scheduling
Concurrency: Mutual Exclusion and Synchronization
Chapter 4: Processes Process Concept Process Scheduling
Channels.
Typically for using the shared memory the processes should:
Channels.
Channels.
CS561 Computer Architecture Hye Yeon Kim
Processes August 10, 2019 OS:Processes.
Presentation transcript:

Asynchronous Message Passing EE 524/CS 561 Wanliang Ma 03/08/2000

Mechanisms for Concurrent Programming Dynamic process creation Semaphores Asynchronous message passing Remote procedure call (RPC) Rendezvous

Call and Send Call : –Synchronous –two-way communication plus synchronization Send : –asynchronous –fork a new instance of a proc –one-way communication

Process Interaction Mechanisms

Asynchronous Message Passing Higher level and more powerful than semaphores Allow processes to communicate Allow processes to synchronize

Asynchronous Message Passing Implemented by having processes send messages to and receive messages from operations The sender continues after sending –asynchronous ( non-blocking) The receiver delays until receiving and removing a message –synchronous (blocking) –an abbreviation for more general mechanism

Outline of Chapter 9 Operations as message queues Semaphores revisited Data-containing semaphores Shared Operations

Operations as Message Queues A new use of operations as message queues The operation has no corresponding proc Receive statements service and remove the invocation of an operation from the message queue The executing process delays if no invocation is present

Operations as Message Queues How to invoke an operation : send and call Send invocation: –the invocation is appended to the message queue –the invoker continues after sending Call invocation : –synchronous form of message passing

Receive statement format receive op_id subscripts ( variable, variable, …)

Examples Stream merging Client-Serve models –one client process and one server process –multiple clients and one server process –multiple clients and multiple servers

Semaphores Revisited Semaphores:abbreviations for operations –a parameterless operation –with send restriction P statements:abbreviations for send statements V statements:abbreviations for receive statements

Semaphores Revisited

The two classes of mechanisms are equally efficient Both are more efficient than a general message passing semaphores make programs more concise and readable

Data-Containing Semaphores A generalization of standard semaphores contain data and a synchronization signal an unbounded buffer of messages that have been produced and not yet consumed Declared within a resource or a global Data is passed as a parameter of a operation

Data-Containing Semaphores Send statements to append data to the operation’s message queue receive statements to remove data from the operation’s message queue synchronization between processes accessing the queue is implicit through their use of send and receive statements

Data-Containing Semaphores Advantages –saves the programmer from having to write code that explicitly implements a list of free buffers and code that synchronizes access to the list. Disadvantages –less efficient

Shared Operations Declared at the top level within a resource or global can not be declared within processes If the operation is declared in a resource, only the processes located in the same resource can share the operation If the operation is declared in a global g, the processes located in g or in any resource or global that imports g can share the operation

Shared Operations applications –multiple instances of a process can service the same resource operation –server work queues

Shared Operations Example: –compute the integral of f(x) from 1 to r. –It employs a shared operation, bag, which contains a bag of tasks –Each task represents a sub-interval over which the integral of f is to be approximated