Process communication is the mechanism provided by the operating system that allows processes to communicate with each other. This communication could involve a process letting another process know that some event has occurred or transferring of data from one process to another. One of the models of process communication is the message passing model.
Message passing model allows multiple processes to read and write data to the message queue without being connected to each other. Messages are stored on the queue until their recipient retrieves them. Message queues are quite useful for interprocess communication and are used by most operating systems.
A diagram that demonstrates message passing model of process communication is given as follows:
In the above diagram, both the processes P1 and P2 can access the message queue and store and retrieve data.
Some of the advantages of message passing model are given as follows:
The message passing model has slower communication than the shared memory model because the connection setup takes time.