tags: message-passing mpi ipc communication
Message Passing
It is an interprocess communication mechanism in which one process sends messages to another process. It can happen on the local processes or processes running on different system on the remote.
There are two system calls to achieve message passing.
send(reciever, &message)
receive(sender, &message)
Different approaches of implementation
- Mailbox: There is a mailbox of each process running. Processes send messages to that mailbox. Mailbox are the buffers of certain size specified when these are created, to store messages.
- Instead of addressing processes in the messages, mailbox for the particular process is addressed.
- Rendezvous: In the mechanism, if a send is done before the receive, the sender will be blocked. If a receive is done before the send, the receive gets blocked.
Note: Message passing is commonly used in parallel programming. One of the well known interfaces for message passing is MPI (Message Passing Interface).