Message passing ( in computer science)

3,703 views 16 slides May 15, 2018
Slide 1
Slide 1 of 16
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16

About This Presentation

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...


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

THANK YOU