Several main methods of communication between processes under Linux and Windows

Linux process communication method:

a) Pipe (Pipe): Named pipe: Pipes can be used for communication between processes with affinities. The famous pipe overcomes the limitation that the pipe has no name. Therefore, in addition to the functions of the pipe, it also allows Communication between unrelated processes;
b) Signal (Signal): Signal is a more complex communication method, used to notify the receiving process that a certain event has occurred. In addition to inter-process communication, the process can also send signals to the process itself; in addition to supporting Unix early signal semantics In addition to the function sigal, it also supports the signal function sigaction whose semantics conform to the Posix.1 standard (in fact, this function is based on BSD. In order to realize a reliable signal mechanism, BSD can unify the external interface and re-implement the signal function with the sigaction function);
c) Message (message queue): Message queue is a linked list of messages, including Posix message queue system V message queue. Processes with sufficient permissions can add messages to the queue, and processes with read permissions can read messages in the queue. The message queue overcomes the shortcomings of the signal carrying less information, the pipeline can only carry unformatted byte streams, and the limited buffer size.
d) Shared memory: allows multiple processes to access the same memory space, which is the fastest form of IPC available. It is designed for the low efficiency 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.
e) Semaphore: Mainly used as a means of synchronization between processes and different threads of the same process.
f) Socket: A more general inter-process communication mechanism that can be used for inter-process communication between different machines. It was originally developed by the BSD branch of the Unix system, but now it can generally be ported to other Unix-like systems: both Linux and System V variants support sockets.

Communication between Linux threads: mutexes, semaphores, condition variables
Communication between Windows threads: critical section (Critical Section), mutex (Mutex), semaphore (Semaphore), event (Event)
Windows inter-process communication: pipes, memory sharing, message queues, semaphores, sockets
What Windows processes and threads have in common: semaphores and messages (events)

May your heart be like flowers and trees

Guess you like

Origin blog.csdn.net/nbcsdn/article/details/104281994