The functions of a messaging interface can differ in their blocking properties. Formally, these are related to the guarantee that a function returns in a finite number of its own steps regardless of the actions of other communication participants:
A blocking function can resort to waiting during the course of its execution. The send operation typically blocks when the buffers at the sender side become full. The receive operation typically blocks when the data buffers at the receiver side become empty.
A nonblocking function never resorts to waiting. In a situation where a blocking operation would block, a nonblocking operation either returns with an indication of failure or returns and uses other means to indicate completion, such as callback or polling.
In simple communication scenarios, the use of blocking operations typically yields shorter and more readable code than the use of nonblocking operations. In complex communication scenarios, where parallel execution of multiple actions is required, the use of nonblocking operations might be necessary.