Main Means of inter-process communication in linux
Source: Internet
Author: User
Several main means of inter-process communication in linux-Linux general technology-Linux programming and kernel information. The following is a detailed description. (1) pipeline (Pipe): the pipeline can be used for communications between kinship processes, allowing one process to communicate with another process with which it has a common ancestor.
(2) named pipe (named pipe): The named pipe overcomes the restriction that the pipe has no name. Therefore, in addition to the functions of the pipe, it also allows communication between unrelated processes. The named pipe has a corresponding file name in the file system. The named pipe is created by running the mkfifo command or by calling the mkfifo command.
(3) Signal: a Signal is a complex communication method used to notify the receiving process of an event, except for inter-process communication, the process can also send signals to the process itself. In addition to supporting the sigal function of the early Unix signal semantics, linux also supports the sigaction function of the Posix.1 standard. (In fact, this function is based on BSD, BSD re-implements the signal function with the sigaction function in order to implement a reliable signal mechanism and unify external interfaces ).
(4) Message Queue: A chain table of messages, including the Posix Message Queue system V Message queue. A process with sufficient permissions can add messages to the queue. A process with the read permission can read messages from the queue. Message Queue overcomes the limitations of insufficient signal carrying information, and pipelines can only bear unformatted byte streams and limited buffer size.
(5) shared memory: Enables multiple processes to access the same memory space, which is the fastest available IPC form. It is designed to reduce the running efficiency of other communication mechanisms. It is often used in conjunction with other communication mechanisms, such as semaphores, to achieve synchronization and mutual exclusion between processes.
(6) memory meming (mapped memory): memory ing allows communication between any process, every process that uses this mechanism maps a shared file to its own process address space.
(7) semaphores (semaphore): it is mainly used for synchronization between processes and between different threads of the same process.
(8) Socket: a more general inter-process communication mechanism, which can be used for inter-process communication between different machines. It was initially developed by the BSD branch of the Unix System, but now it can be transplanted to other Unix-like systems: both Linux and System V variants support sockets.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.