What Is Interprocess Communication?

Inter-process communication is the dissemination or exchange of information between different processes, so what media can be accessed by both parties between different processes? The user space of a process is independent of each other and generally cannot be accessed by each other. The only exception is the shared memory area. In addition, the system space is a "public place" and all processes can access it, so the kernel can also provide such conditions. In addition, there are peripherals that both parties can access. In this sense, of course, the two processes can also exchange information through ordinary files on the disk, or through certain entries and records in the "registry" or other databases. In a broad sense, this is also a means of inter-process communication, but it is generally not counted as "inter-process communication".

Inter-process communication

This entry lacks an overview map . Supplementing related content makes the entry more complete and can be upgraded quickly. Come on!
Inter-process communication is the dissemination or exchange of information between different processes, so what media can be accessed by both parties between different processes? Process
Interprocess communication (IPC, Interprocess communication) is a set of programming interfaces that allows programmers to coordinate different processes so that they can run simultaneously in an operating system and pass information to each other. This enables a single program to handle many user requests at the same time. Because even if only one user makes a request, it may cause multiple processes in an operating system to run, and processes must talk to each other. The IPC interface offers this possibility. Each IPC method has its own advantages and limitations. In general, it is not common for a single program to use all IPC methods.

IPC methods include PIPE, message queuing, semaphores, shared memory, and sockets. [1]
1) Data transmission: A process needs to send its data to another process, and the amount of data sent is between one byte and several megabytes.
2) Shared data: Multiple processes want to manipulate shared data. One process should modify the shared data and other processes should see it immediately.
3) Notification events: a process needs to send a message to another process or group of processes to inform it (they) that some kind of event has occurred (such as when the process terminates
Signals are one of the oldest methods of interprocess communication used in Unix systems. The operating system notifies the process of a certain pre-defined event (one of a set of events) through a signal. It is also a primitive mechanism for communication and synchronization between user processes. A keyboard interrupt or an error condition (such as a process trying to access its
Normal Linux shells allow redirection, and redirection uses pipes. E.g:
$ ls | pr | lpr
Pipe the output of the command ls (list the files in the directory) to the standard input of the command pr
System V IPC Mechanisms
Although the signals and pipes discussed earlier can communicate between processes, there are many applications that cannot meet the IPC requirements. So for the first time in System V UNIX (1983), three other inter-process communication mechanism (IPC) mechanisms were introduced:
Pipes are divided into named pipes and unnamed pipes. Unnamed pipes can only be used for communication between relative processes, and famous pipes can be used between unrelated processes.
Under Linux,
Efficiency comparison of various methods of inter-process communication
Types of
no connection
reliable
Flow control
recording
Message type priority
Common PIPE
N
Y
Y
N
Stream PIPE
N
Y
Y
N
Named PIPE (FIFO)
N
Y
Y
N
message queue
N
Y
Y
Y
signal
N
Y
Y
Y
Shared storage
N
Y
Y
Y
UNIX Stream SOCKET
N
Y
Y
N
UNIX packet SOCKET
Y
Y
N
N

IN OTHER LANGUAGES

Was this article helpful? Thanks for the feedback Thanks for the feedback

How can we help? How can we help?