-
Notifications
You must be signed in to change notification settings - Fork 2
Inter Process Communication (IPC)
Programs running on a machine must be able to communicate with each other for any large and useful program. Since UNIX compartmentalizes each running program into its own process, all communication between processes (aptly called Interprocess Communication, or IPC) must go through the operating system. The operating system provides several methods of IPC, all offering their own advantages and disadvantages. A major design decision in any major software project is which type of interprocess communication to use.
The pages in this section go into several major types of interprocess communication, all of which are used somewhere in Runtime. To not repeat content, a summary will not be written here; please read the actual pages for an in-depth look at what each IPC method is and how to use it.
However, we will provide a chart here illustrating some of the key differences between the various IPC methods:
Bidirectional | Processes Must Have Parent-Child Relationship | Can Have Multiple Readers/Writers | |
---|---|---|---|
Pipes | No | Yes | No |
FIFO | No | No | Yes |
Serial | Yes | No | No |
Shared Memory | Yes | No | Yes |
Signals | No | Yes | N/A |
Sockets (TCP) | Yes | No | No |
Sockets (UDP) | Yes | No | Yes |
Sockets (Unix; Streams) | Yes | No | No |
Sockets (Unix; Datagrams) | Yes | No | Yes |
(continued)
Reliable | Connection-Oriented | Use Over Network | Use Over USB | Use Within Same Machine | Has Name on File System | |
---|---|---|---|---|---|---|
Pipes | Yes | Yes | No | No | Yes | No |
FIFOs | Yes | No | No | No | Yes | Yes |
Serial | No | No | No | Yes | No | Yes |
Shared Memory | N/A | N/A | No | No | Yes | Yes (on Linux) |
Signals | Yes | N/A | No | No | Yes | No |
Sockets (TCP) | Yes | Yes | Yes | No | Yes (using 127.0.0.1 ) |
No |
Sockets (UDP) | No | No | Yes | No | Yes (using 127.0.0.1 ) |
No |
Sockets (Unix; Streams) | Yes | Yes | No | No | Yes | Yes |
Sockets (Unix; Datagrams) | Yes | No | No | No | Yes | Yes |
- Important
- Advanced/Specific