Skip to content

270 Interprocess communication protocol

Videos

Interprocess communication (IPC)

IPC (Inter-Process Communication) refers to the mechanisms and techniques used by operating systems to allow different processes to communicate with each other. In a multitasking operating system, multiple processes may be running simultaneously, and they may need to exchange information or coordinate their activities. IPC provides a standardized set of tools for these processes to communicate and synchronize with each other. Some common IPC mechanisms include shared memory, message queues, pipes, and sockets. Shared memory allows multiple processes to access the same block of memory, while message queues enable processes to exchange messages with each other. Pipes and sockets are used for inter-process communication over a network or between processes on the same machine.

Kindly written by ChatGPT

Unix pipes

Pipes are an integral part of the operating system and can therefore be easily integrated into a program / script. Pipes are also supported directly in the command line (The symbole | is used in the shell for a pipe function). This makes it easy to combine and execute multiple shell commands.

ls -l | wc

Sockets

A socket is an object provided by the operating system that serves as a communication endpoint for any kind of IPC. Sockets are used to exchange data between different processes/threads on the same or different systems (distributed computing). Communication via sockets is usually bidirectional, i.e. data can be both received and sent via the socket. The best known example where sockets are used is the classic HTTP protocol. That is, the communication that is used when browsing the Internet.