Inter Process Communication (IPC) in OS
โก Smart Summary
Inter-process communication (IPC) is a set of operating system mechanisms that let processes and threads exchange data, coordinate activities, and synchronize actions, whether they run on one computer or across several machines connected by a network.

What is Inter Process Communication?
Inter process communication (IPC) is used for exchanging data between multiple threads in one or more processes or programs. The processes may be running on a single computer or on multiple computers connected by a network. The full form of IPC is inter-process communication.
It is a set of programming interfaces that allow a programmer to coordinate activities among various program processes, which can run concurrently in an operating system. This allows a single program to handle many user requests at the same time.
Since every user request may result in multiple processes running in the operating system, these processes may need to communicate with each other. Each IPC approach has its own advantages and limitations, so it is not unusual for a single program to use several of the IPC methods.
Approaches for Inter-Process Communication
Here are a few important methods for inter-process communication:
Inter-Process Communication Approaches
Pipes
A pipe is widely used for communication between two related processes. This is a half-duplex method, so the first process communicates with the second process. However, to achieve full-duplex communication, another pipe is needed.
Message Passing
It is a mechanism for a process to communicate and synchronize. Using message passing, processes communicate with each other without resorting to shared variables.
The IPC mechanism provides two operations:
- Send (message) โ the message size can be fixed or variable
- Receive (message)
Message Queues
A message queue is a linked list of messages stored within the kernel. It is identified by a message queue identifier. This method offers communication between single or multiple processes with full-duplex capacity.
Direct Communication
In this type of inter-process communication, processes must name each other explicitly. In this method, a link is established between one pair of communicating processes, and between each pair, only one link exists.
Indirect Communication
Indirect communication is established only when processes share a common mailbox. Each pair of processes can share several communication links, and a single link can communicate with many processes. The link may be bidirectional or unidirectional.
Shared Memory
Shared memory is a region of memory shared between two or more processes. This memory must be protected from concurrent access by synchronizing the processes that use it.
FIFO
FIFO is used for communication between two unrelated processes. It is a full-duplex method, which means that the first process can communicate with the second process, and the opposite can also happen.
Why IPC?
Here are the reasons for using the inter-process communication protocol for information sharing:
- It helps to speed up modularity.
- Computational speedup.
- Privilege separation.
- Convenience.
- It helps processes and the operating system communicate and synchronize their actions.
Terms Used in IPC
The following are a few important terms used in IPC:
Semaphores: A semaphore is a signaling mechanism. This OS method either allows or disallows access to a resource, depending on how it is set up.
Signals: A signal is a method of communicating between multiple processes by way of signaling. The source process sends a signal, which is recognized by a number, and the destination process handles it.
Reading Suggestion: What is Semaphore? Binary, Counting Types with Example
What is Like FIFOS and Unlike FIFOS
The following table compares like FIFOs and unlike FIFOs:
| Like FIFOS | Unlike FIFOS |
|---|---|
| It follows the FIFO method. | It uses a method to pull specific urgent messages before they reach the front. |
| FIFO exists independently of both the sending and receiving processes. | Always ready, so there is no need to open or close it. |
| Allows data transfer among unrelated processes. | Does not have any synchronization problems between open and close. |

