Message Passing

" What is Message Passing in Interprocess Communication ?"

It refers to means of communication between

- Different thread with in a process .
- Different processes running on same node.
- Different processes running on different node.

In this a sender or a source process send a message to a non receiver or destination process. Message has a predefined structure and message passing uses two system call: Send and Receive

send(name of destination process, message);

receive(name of source process, message);

Message passing

In this calls, the sender and receiver processes address each other by names. Mode of communication between two process can take place through two methods

1) Direct Addressing
2) Indirect Addressing

Direct Addressing:

In this type that two processes need to name other to communicate. This become easy if they have the same parent.


If process A sends a message to process B, then

send(B, message);
Receive(A, message);

By message passing a link is established between A and B. Here the receiver knows the Identity of sender message destination. This type of arrangement in direct communication is known as Symmetric Addressing.

Symmetric addressing

Another type of addressing known as asymmetric addressing where receiver does not know the ID of the sending process in advance.

Asymmetric addressingdiagram:

Indirect addressing:

In this message send and receive from a mailbox. A mailbox can be abstractly viewed as an object into which messages may be placed and from which messages may be removed by processes. The sender and receiver processes should share a mailbox to communicate.

The following types of communication link are possible through mailbox.

- One to One link: one sender wants to communicate with one receiver. Then single link is established.

- Many to Many link: Multiple Sender want to communicate with single receiver.Example in client server system, there are many crying processes and one server process. The mailbox is here known as PORT.

- One to Many link: One sender wants to communicate with multiple receiver, that is to broadcast message.

- Many to many: Multiple sender want to communicate with multiple receivers.

23- Interprocess Communication- Message Passing- Operating System Tutorial


Mail box

Facebook Likes