Inner-Process Communications
About 579 wordsAbout 2 min
2025-08-02
What is Inter-Process Communication (IPC)?
Inter-Process Communication (IPC) refers to all mechanisms that allow two or more processes to exchange messages and data. These mechanisms can be categorized based on their scope:
- Local IPC: Communication is restricted to processes running on the same host machine's operating system.
- Networked IPC: Communication is permitted between processes on different host machines connected via a network.
Local IPC Mechanisms
IPC mechanisms restricted to a single host operating system typically include:
- Shared Memory: This method works by mapping shared pages of memory into the address space of two or more processes, allowing them to read and write to a common memory area. Shared memory is very fast but imposes no structure on the data being exchanged.
- Message Passing: Processes communicate by sending and receiving formatted messages.
- Unix Signals (and analogues): A simple form of IPC where one process can send a signal (a notification) to another.
Unlike the free-form nature of shared memory, both Message Passing and Signals typically require messages to adhere to a discrete, predefined structure.
Stream-Oriented IPC
Stream-oriented communication is one of the most common schemes used for both local and networked IPC.
How It Works
A stream connection is unstructured, handling data as a First-In, First-Out (FIFO) sequence of bytes or characters. The stream typically arrives at the destination in the same order it was sent, making it behave like a transparent pipe from the perspective of an application protocol.
The two most widely used stream-oriented IPC mechanisms are BSD Sockets and SVR4 STREAMS, both of which are designed around standard Application Programming Interfaces (APIs). These APIs are provided by middleware, which sits between the user application and the operating system's protocol stack (like TCP/UDP).
Channel Properties
- Reliability: The communication channel is considered "reliable" when it connects two processes on a single host or across a network using the TCP protocol. It is "unreliable" when using the UDP protocol for networked communication.
- Ordering: Stream IPC connections almost always deliver messages "in order," behaving like a FIFO queue or pipe.
- Behavior: The interface can be either "blocking" or "non-blocking" depending on the API and its configuration, which determines whether a process must wait for a message transfer to complete.
Performance Considerations
In parallel applications running on distributed platforms like clusters and clouds, IPC performance is a critical challenge. There are two primary metrics for performance:
- Latency (Delay): The total time it takes for a message to travel from the sending process to the receiving process.
- Throughput (Bandwidth): The volume of data that can be sent over a link per unit of time (e.g., Gigabits/second).
Even on high-bandwidth networks, latency can be significant, especially in applications with data dependencies where one process must wait for data from another before it can continue.
Sources of Latency in Data Centers
In a typical data center, latency accumulates from several sources as a packet travels from a source node to a destination node:
- Node Delays: Delays within the source and destination nodes caused by the middleware and the operating system's protocol stack processing.
- Router Delays: Queuing and processing delays at each router the packet passes through in the network fabric.
- Propagation Delays: The physical time it takes for the signal to travel through the network cables, which is proportional to the total path length.
Changelog
2b7ff
-web-deploy(Auto): Update base URL for web-pages branchon
Copyright
Copyright Ownership:WARREN Y.F. LONG
License under:Attribution-NonCommercial-NoDerivatives 4.0 International (CC-BY-NC-ND-4.0)