The Shared Memory and Message Passing Models of Interprocess Communication
The Shared Memory Model
In this model stored information in a shared region of memory is processed, possibly under the control of a supervisor process.
An example might be a single node with
- multiple cores
- share a global memory space
- cores can efficiently exchange/share data
The Message Passing Model
In this model, data is shared by sending and receiving messages between co-operating processes, using system calls .
Message Passing is particularly useful in a distributed environment
where the communicating processes may reside on different, network connected, systems.
Message passing architectures are usually easier to implement but are also usually slower than shared memory architectures.
An example might be a networked cluster of nodes
- nodes are networked together.
- each with multiple cores.
- each node using its own local memory. /li>
- communicate between nodes and cores via messages.
A message might contain:
- Header of message that identifies the sending and receiving processes
- A block of data
- Process control information
Typically Inter-Process Communication is built on two operations, send() and receive()
involving communication links created between co-operating processes.