Python: unix inter-process communication (IPC)

Pipe (Pipe): having a communication conduit may be used for genetic relationship between the process, a process and allows it to communicate with other processes between the common ancestor.
Named pipes (named pipe): Named Pipes overcome the limitations pipeline with no name, therefore, in addition to a pipe with the functions, it also allows no communication between the kinship process. Named pipes have corresponding file name in the file system. Named Pipes mkfifo command or system call mkfifo to create.
Signal (Signal): the signal is more complex communication mode for receiving the notification process has some event occurs, except for inter-process communication, the process can also send a signal to the process itself; Linux early signal Unix semantics in addition to supporting function sigal but also support signal sigaction function semantics conform Posix.1 standard (in fact, the function is based on the BSD, BSD order to achieve reliable signal mechanism, but also to unify external interface, use sigaction function to re-implement the signal function).
Message (Message) queues: a message queue is a linked list of messages, including a message queue Posix system V message queue. Has sufficient rights process can add a message to the queue, was given permission to read a process you can go read messages in the queue. Signal bearing the message queue overcome small amount of information, only the carrier pipe and the plain byte stream buffer size is limited by the lack of other
shared memory: such that a plurality of processes can access the same memory space, the available forms is the fastest IPC. For other communication mechanism is not efficient design. Often, such as semaphores in conjunction with other communication mechanism, to achieve synchronization and mutual exclusion between processes.
Memory map (mapped memory): memory mapping allows communication between any multiple processes, each process through the use of the mechanism to map a shared file to its own process address space to achieve it.
Semaphore (semaphore): mainly as a means of inter-process synchronization as well as between the different threads in the same process.
Socket (Socket): more general inter-process communication mechanism can be used for inter-process communication between the different machines. It was originally developed by BSD Unix systems branch out, but they are generally portable to other Unix-like systems: Linux and System V variants support sockets.

Guess you like

Origin blog.csdn.net/weixin_44523387/article/details/91973774