- Process can be executed concurrently in the operating system, can be divided into
- Independent process: cannot affect or be affected by the other processes
- Cooperating process: can affect or be affected by the other processes. (Any process that shares data with other processes is a cooperating process)
Approaches for Inter Process Communication:
- Local IPC (IPC on the same device):
- Pipes: Usually a half-duplex method. The filling process is writing into the pipe and the reading process is retrieved from the pipe
- Message Queue: We have a linked list to store messages in a kernel of OS and a message queue is identified using "message queue identifier"
- Shared Memory: Processes share a portion of memory to exchange data.
- Sockets (Unix Domain Sockets): Sockets can be used for communication between processes on the same device using Unix domain sockets, which are similar to network sockets but do not involve network communication.
- Remote IPC (IPC across devices):
- Sockets (Network Sockets): Full-duplex. Processes communicate over a network using network sockets, which allow processes to establish connections and exchange data over long distances. TCP/IP handshakes are facilitated and completed using sockets. For example, real-time chatting.
Data Transmission Modes
According to the data transmission modes, those IPC approaches can be:
- Full-duplex: both communicating parties can send and receive data at the same time. For example, telephone conversations, modern networking technologies.
- Half-duplex: like full-duplex, allows data to flow in both directions, but not simultaneously. For example, walkie-talkies are an example of half-duplex communication, where you have to press a button to transmit and release it to listen.
- Simplex: one-way communication method where data can only flow in one direction. One party acts as the sender, and the other party acts as the receiver. For example,radio broadcasts and traditional TV broadcasts