There are two primary forms of data exchange between parallel tasks - accessing a shared data space and exchanging messages.
Message passing refers to a means of communication between
different threads within a process
different processes running on the same node
different processes running on diff...
There are two primary forms of data exchange between parallel tasks - accessing a shared data space and exchanging messages.
Message passing refers to a means of communication between
different threads within a process
different processes running on the same node
different processes running on different nodes
When messages are passed between two different processes we speak of inter-process communication, or IPC.
Message passing can be used as a more process-oriented approach to synchronization than the "data-oriented" approaches used in providing mutual exclusion for shared resources.
The two main dimensions
Synchronous vs. asynchronous
Symmetric or asymmetric process/thread naming
Size: 83.33 KB
Language: en
Added: May 15, 2018
Slides: 16 pages
Slide Content
Message passing Interprocess communication Presented by asmita
Inter-process communication When messages are passed between two different processes we speak of inter-process communication. Message is a block of information. Communication may be of two types. Message passing. Shared memory.
Message passing Message passing is a paradiagram of communication where messages are sent from a sender to one or more recipent . OR Message passing refers to mean of communication between: Different threads within a process. Different processes running on same node. Different processes running on different node.
MESSAGE has a predefined structure. Message passing uses two system calls: Send(name of destination process, message); Receive(name of source process , message);
Message passing COMMUNICTION Mesaage passing communication may be of two types. Direct communication: Explicitly name the process you are communicating with. Indirect comunication : communicate using mailboxes owned by receiver.
Direct communication INDIRECT COMMUNICATION
Message passing uses two system calls . Send(B, message); Receive(A, message); A B Direct communication Symmetric addressing: Send( B ,msg ) Receive( A,msg )
Direct communication Asymmetric addressing: A B Message passing uses 2 system call: Send(B, message) Receive( message) Send( B ,Msg ) Receive( msg )
INDIRECT COMMUNICATION INDIRECT COMMUNICATION MAIL BOX
Synchronous message passing: requires the sender and receiver to wait for each other to transfer the message. Blocking send. Blocking receive. Asynchronous message passing: delivers a message from sender to receiver, without waiting for a receiver to be ready. Non blocking send . Non blocking receive.
SYNCHRONOUS MESSAGE PASSING BLOCKING SEND door Waiting busy msg
SYNCHRONOUS MESSAGE PASSING Blocking receive door Busy waiting
Asynchoron0us message passing Non-blocking send msg msg MAIL BOX
NON-bloc king receive msg MAIL BOX door Zzzzzz
The following types of communication link are possible through mailbox One-to-one link Many-to-one link One-to-many link Many-to-many link