What is Inter process communication?

Operating SystemHardwareSoftware & Coding

Inter process Communication (IPC) is a mechanism which allows the exchange of data between processes. It enables resource and data sharing between the processes without interference.

Processes that execute concurrently in the operating system may be either independent processes or cooperating processes.

A process is independent and it may or may not be affected by other processes executing in the system. Any process that does not share data with any other process is independent.

Suppose if a process is cooperating then, it can be affected by other processes that are executing in the system. Any process that shares the data with another process is called a cooperative process.

Given below is the diagram of inter process communication −

Reasons for Process Cooperation

There are several reasons which allow process cooperation, which is as follows −

  • Information sharing − Several users are interested in the same piece of information. We must provide an environment to allow concurrent access to such information.

  • Computation speeds up − If we want a particular task to run faster, we must break it into subtasks, then each will be executed in parallel with the other. The speedup can be achieved only if the computer has multiple processing elements.

  • Modularity − A system can be constructed in a modular fashion dividing the system functions into separate processes or threads.

  • Convenience − An individual user may work on many tasks at the same time. For example, a user may be editing, compiling, and printing in parallel.

The cooperative process requires an IPC mechanism that will allow them to exchange data and information.

IPC Models

There are two fundamental models of IPC which are as follows −

Shared memory

A region of memory that is shared by cooperating processes is established. Processes can then exchange information by reading and writing data to the shared region.

Message passing

Communication takes place by means of messages exchanged between the cooperating processes. Message passing is useful for exchanging small amounts of data because no conflicts need be avoided.

It is easier to implement when compared to shared memory by using system calls and therefore, it requires more time-consuming tasks of the kernel.

raja
Published on 01-Dec-2021 11:43:02
Advertisements