IPC: Message Passing
When two or more processes communicate via message passing, each process can send messages to other processes and receive messages therefrom. The operating system actively behaves as the middleperson in passing the messages.
- Message passing requires system calls for every message transfer, and is therefore slower than memory sharing.
- However, it is simpler to set up and works well across multiple computers.
- Message passing is generally preferable when the amount and/or frequency of data transfers is small, or when multiple computers are involved.
- These systems must, at a minimum, support system calls for "sending a message" and "receiving a message".
- A message passing system must decide on (1) whether the sender must know the name of the receiver to which a message it to be sent, (2) whether sending or receiving messages can be blocking or non-blocking, and (3) how many messages are allowed to be stored by the OS temporarily before the receiver reads them.