Explain different methods of inter process communication with help of diagram | Operating System Question & Answer

There are two methods of Inter Process Communication:
Shared memory: 
In this a region of the memory residing in an address space of a process creating a shared memory segment can be accessed by all processes who want to communicate with other processes. All the processes using the shared memory segment should attach to the address space of the shared memory. All the processes can exchange information by reading and/or writing data in shared memory segment. The form of data and location are determined by these processes who want to communicate with each other. These processes are not under the control of the operating system. The processes are also responsible for ensuring that they are not writing to the same location simultaneously. After establishing shared memory segment, all accesses to the shared memory segment are treated as routine memory access and without assistance of kernel. 

Message Passing: 
In this model, communication takes place by exchanging messages between cooperating processes. It allows processes to communicate and synchronize their action without sharing the same address space. It is particularly useful ina distributed environment when communication process may reside on a different computer connected by a network.Communication requires sending and receiving messages through the kernel.The processes that want to communicate with each other must have a communication link between them. Between each pair of processes exactly one communication link. 
 

Post a Comment

0 Comments