What are the main ways of communication between user processes

Pipeline:

Pipes can be used for communication between processes with affinity, allowing communication between one process and another process that has a common ancestor with it.

named pipe:

Named pipes overcome the limitation that pipes do not have names. Therefore, in addition to the functions of pipes, they also allow communication between unrelated processes. Named pipes have corresponding file names in the file system. Named pipes
are created with the command mkfifo or the system call mkfifo.

Signal:

Signal is a relatively complex communication method, which is used to notify the accepting process that a certain event has occurred. In addition to being used for inter-process communication, the process can also send a signal to the process itself; in addition to supporting the Unix early signal semantic function sigal, Linux also supports
semantic The signal function sigaction conforms to the Posix.1 standard (actually, this function is based on BSD
. In order to realize a reliable signal mechanism and unify the external interface, BSD re-implemented the signal function with the sigaction function)

Message queue:

A message queue is a linked list of messages, including the Posix message queue system V
message queue. Processes with sufficient permissions can add messages to the queue, and processes that have been granted read permissions can read messages in the queue. The message queue overcomes the shortcomings of the small amount of information carried by the signal, the pipeline can only carry the unformatted byte stream, and the buffer size is limited.

Shared memory:

Allowing multiple processes to access the same memory space is the fastest
form of IPC available. It is designed for the inefficiency of other communication mechanisms. It is often used in combination with other communication mechanisms, such as semaphores, to achieve synchronization and mutual exclusion between processes.

Semaphore:

It is mainly used as a means of synchronization between processes and between different threads of the same process.

Socket (Socket):

A more general interprocess communication mechanism that can be used for interprocess communication between different machines. Originally developed by the BSD branch of the Unix system, it is now generally portable to other
Unix-like systems: both Linux and System V variants support sockets

Guess you like

Origin blog.csdn.net/weixin_43072508/article/details/128676603