Since interactions are accomplished by sending and receiving messages, the basic operations in the message-passing programming paradigm are send and receive.
In their simplest form, the prototypes of these operations are defined as follows:
send(void *sendbuf, int nelems, int dest)
receive(void *recvbuf, int nelems, int source)
sendbuf points to a buffer that stores the data to be sent,
recvbuf points to a buffer that stores the data to bereceived,
nelems is the number of data units to be sent and received,.
dest is the identifier of the process that receives the data,.
source is the identifier of the process that sends the data.
Process sends a message to process which receives and prints the message.
The important thing to note is that process changes the value of a to 0 immediately following the send.
The semantics of the send operation require that the value received by process must be 100 (not 0).
That is, the value of at the time of the send operation must be the value that is received by process .
It may seem that it is quite straightforward to ensure the semantics of the send and receive operations.
However, based on how the send and receive operations are implemented this may not be the case.