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. 1. Message passing. 2. 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: 1. Different threads within a process. 2. Different processes running on same node. 3. Different processes running on different node.
• MESSAGE has a predefined structure. • Message passing uses two system calls: 1. Send(name of destination process, message); 2. Receive(name of source process , message);
MESSAGE PASSING COMMUNICTION Mesaage passing communication may be of two types. 1. Direct communication: Explicitly name the process you are communicating with. 2. 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
1. Synchronous message passing: requires the sender and receiver to wait for each other to transfer the message. • Blocking send. • Blocking receive. 1. 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-blocking 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
Message passing ( in computer science)

Message passing ( in computer science)