In the standard message passing model, messages can be copied many times: from the user buffer to the kernel buffer (the output buffer of a channel), from the kernel buffer of the sending computer (process) to the kernel buffer in the receiving computer (the input buffer of a channel), and finally from the kernel buffer of the receiving computer (process) to a user buffer.
Null Buffer (No Buffering)
In this case, there is no place to temporarily store the message. Hence one of the following implementation strategies may be used:
- The message remains in the sender process’s address space and the execution of the send is delayed until the receiver executes the corresponding receive.
- The message is simply discarded and the time-out mechanism is used to resend the message after a timeout period. The sender may have to try several times before succeeding.
There are three types of buffering strategies used in inter process communication
In single-message buffer strategy, a buffer having a capacity to store a single message is used on the receiver’s node. This strategy is usually used for synchronous communication, an application module may have at most one message outstanding at a time.
In the asynchronous mode of communication, since a sender does not wait for the receiver to be ready, there may be several pending messages that have not yet been accepted by the receiver. Therefore, an unbounded-capacity message-buffer that can store all unreceived messages is needed to support asynchronous communication with the assurance that all the messages sent to the receiver will be delivered.
Unbounded capacity of a buffer is practically impossible. Therefore, in practice, systems using asynchronous mode of communication use finite-bound buffers, also known as multiple-message buffers. In this case message is first copied from the sending process’s memory into the receiving process’s mailbox and then copied from the mailbox to the receiver’s memory when the receiver calls for the message.
When the buffer has finite bounds, a strategy is also needed for handling the problem of a possible buffer overflow. The buffer overflow problem can be dealt with in one of the following two ways:
- Unsuccessful communication. In this method, message transfers simply fail, whenever there is no more buffer space and an error is returned.
Flow-controlled communication. The second method is to use flow control, which means that the sender is blocked until the receiver accepts some messages, thus creating space in the buffer for new messages. This method introduces a synchronization between the sender and the receiver and may result in unexpected deadlocks. Moreover, due to the synchronization imposed, the asynchronous send does not operate in the truly asynchronous mode for all send commands.