Inter Process Communication (IPC)
Inter Process Communication (IPC)
Communication (IPC)
• Inter Process Communication (IPC)
A process can be of two types:
Independent process.
Co-operating process.
An independent process is not affected by the execution of other
processes while a co-operating process can be affected by other
executing processes.
• Cooperating processes require an interprocess communication (IPC)
mechanism that will allow them to exchange data and information.
There are two fundamental models of interprocess communication:
(1) shared memory.
(2) message passing.
Shared Memory
• An operating system can implement both method of communication.
Communication between processes using shared memory requires processes to
share some variable and it completely depends on how programmer will
implement it. One way of communication using shared memory can be imagined
like this: Suppose process1 and process2 are executing simultaneously and they
share some resources or use some information from another process. Process1
generate information about certain computations or resources being used and
keeps it as a record in shared memory. When process2 needs to use the shared
information, it will check in the record stored in shared memory and take note of
the information generated by process1 and act accordingly. Processes can use
shared memory for extracting information as a record from another process as
well as for delivering any specific information to other processes.
Message Passing
• Message passing provides a mechanism to allow processes to
communicate and to synchronize their actions without sharing the
same address space and is particularly useful in a distributed
environment, where the communicating processes may reside on
different computers connected by a network.
• The message size can be of fixed size or of variable size. If it is of
fixed size, it is easy for an OS designer but complicated for a
programmer and if it is of variable size then it is easy for a
programmer but complicated for the OS designer.