Inter-process communication

Hi, How are you !! Hope you doing good....
I got introduced to Cloud initially. As I went ahead learning what is cloud and how it works, then got to know a field which is DevOps that makes Cloud model more effective.
So, as I started working & got good experience on AWS. I have been learning the DevOps tool and technologies on how to use it with the Cloud, which will give me good understanding on how Cloud and DevOps go hand in hand to deploy my applications.
Last Blog Review →
In the last blog we understood, what is a trap command. Why we use the trap command. The syntax of the trap command. And the real-world example of the trap command.
Today’s Agenda → Learning why Inter-process communication is important.
What is inter-process communication ?
We understood what is process i.e. a running program with its own memory space, own execution state. So, this process are isolated from each other.
Inter-process communication is a set of kernel-provided mechanisms that allow process to exchange data, signal events, sync execution.
In short, Inter-process communication is a controlled data exchange between independent processes via. the operating system.
Why inter-process communication is required ?
We know that for processes, direct memory sharing is not allowed due to following reasons:
A. To prevent security breach
B. Crash propagation
C. Undefined behavior
The core problem IPC solves - IPC provides controlled sharing :
A. Kerner-approved
B. Permission checked
C. Synchronization aware
IPC real world examples
Shell Pipeline
ps aux | grep rootWhat happens internally:
Shell forks two processes
Kernel creates a pipe
pswrites output to pipegrepreads input from pipe
Without IPC:
grepcannot accesspsoutputPipeline concept fails entirely
📌 IPC enables producer–consumer models
IPC is required for client-server architecture
Database Server (PostgreSQL)
Architecture:
One server process
Many client processes
Clients need to:
Send SQL queries
Receive results
They use:
UNIX domain sockets
Or TCP sockets
Without IPC:
Each client would need its own DB engine
No centralized data consistency
Massive resource duplication
➡️ IPC enables service-oriented design
Multiple ways to do IPC -
Named pipes : These allow processes to read from and write into it.
Shared memory : This is created by one process and is further available for read from and write to this memory by multiple processes.
Message queue : This is a structured and an ordered list of memory segments where processes store or retrieve data in queue fashion.
Semaphores : This provides a synchronizing mechanism for processes that are accessing the same resource. It has counters that are used to control the access to shared resources by multiple processes.
Conclusion →
In this blog we understood, what is inter-process communication, why inter-process communication. Some real-time examples of it.



