Prerequisite – Inter Process Communication
1. Shared Memory Model :
In this IPC model, a shared memory region is established which is used by the processes for data communication. This memory region is present in the address space of the process which creates the shared memory segment.The processes who want to communicate with this process should attach this memory segment into their address space.
2. Message Passing Model :
In this model, the processes communicate with each other by exchanging messages. For this purpose a communication link must exist between the processes and it must facilitate at least two operations send (message) and receive (message). Size of messages may be variable or fixed.
Difference between Shared Memory Model and Message Passing Model in IPC :
|S.No||Shared Memory Model||Message Passing Model|
|1.||Shared memory region is used for communication.||Message passing facility is used for communication.|
|2.||It is used for communication between processes on a single processor or multiprocessor systems where the communicating processes reside on the same machine as the communicating processes share a common address space.||It is typically used in a distributed environment where communicating processes reside on remote machines connected through a network.|
|3.||The code for reading and writing the data from the shared memory should be written explicitly by the Application programmer.||No such code required here as the message passing facility provides mechanism for communication and synchronization of actions performed by the communicating processes.|
|4.||It provides maximum speed of computation as communication is done through shared memory so system calls are made only to establish the shared memory.||It is time consuming as message passing is implemented through kernel intervention (system calls).|
|5.||Here the processes need to ensure that they are not writing to the same location simultaneously.||It is useful for sharing small amounts of data as conflicts need not to be resolved.|
|6.||Faster communication strategy.||Relatively slower communication strategy|
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Difference between Prototype Model and Spiral Model
- Difference between E-R Model and Relational Model in DBMS
- Difference between Waterfall model and Incremental model
- Difference between Relational model and Document Model
- Difference between Waterfall Model and Spiral Model
- Difference between Agile Model and V-Model
- Difference between RAD Model and Waterfall Model
- Difference between Bottom-Up Model and Top-Down Model
- Difference between V-model and Waterfall model
- Difference between Parallel Virtual Machine (PVM) and Message Passing Interface (MPI)
- Difference between ER Model and RDBMS
- Difference Between Model Parameters VS HyperParameters
- Difference between Hierarchical and Relational data model
- Difference between Hierarchical and Network Data Model
- Message Passing in Java
- Differences between Dynamic Binding and Message Passing in Java
- IPC through shared memory
- Algorithm for implementing Distributed Shared Memory
- Difference between Shared Nothing Architecture and Shared Disk Architecture
- Basic Model of a Real-time System
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.