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 shared memory model.
The shared memory in the shared memory model is the memory that can be simultaneously accessed by multiple processes. This is done so that the processes can communicate with each other. All POSIX systems, as well as Windows operating systems use shared memory.
A diagram that illustrates the shared memory model of process communication is given as follows −
In the above diagram, the shared memory can be accessed by Process 1 and Process 2.
Memory communication is faster on the shared memory model as compared to the message passing model on the same machine.
Some of the disadvantages of shared memory model are as follows −