Communication between Linux process

pipeline

Pipeline is supported by most Linux grass IPC (interprocess communication), it can be divided into a named pipe and unnamed pipes

Unnamed pipes

1. The pipe is half-duplex, can only support one-way flow, two processes need to establish a communication channel for two

2. unnamed pipe () function created by the pipe, it can only be used between parent and child or sibling process

3. A process to write data to the pipe, the pipe is added to the end of the buffer, another process read when reading from the buffer head

Named Pipes

Named pipe is half-duplex, but it allows communication between any two of the named pipe to provide a process for pathname associated therewith, in a FIFO manner is present in the file system

signal

Mentioned semaphore can think of P / V operation, i.e. wait () and Sinal () operation. Semaphore is a counter, can control access to shared resources among multiple threads or processes among multiple processes, implemented as a mechanism to lock.

signal

The operating system can be based on different signals of different approaches, using the default processing mode, that process is interrupted or quit, another mechanism may also be used, that is to ignore the signal, the other is a custom handler, perform the appropriate operating

message queue

Is a form of message queues of the linked list, which allows one or more processes to write data, the one or more data read process,

Shared memory

Shared memory is memory mapped a period that can be accessed by other processes. The memory is created by a process, other processes can then be mounted to the shared memory. Shared memory is among the fastest-process communication, but does not support concurrency control, it is usually with the semaphore mechanism to achieve inter-process communication

socket

Communication between the socket is also a process, but otherwise the difference is the way you can communicate between different hosts

Guess you like

Origin www.cnblogs.com/lgxblog/p/11570440.html