How to communicate between processes:
1) There are also named pipes and non-named pipes in the pipeline, non-named pipes can only be used for parent-child process communication, named pipes can be used for non-parent-child processes, named Pipes are FIFO, pipeline is a first-out communication mode. FIFO is a first-in-one-out queue. It is similar to a pipeline that allows only one-way flow of data. Each FIFO has a name that allows unrelated processes to access the same FIFO and therefore also becomes a named tube.
2) Message Queuing: is used for communication between two processes, first creating a message queue in one process, then writing the data to the message queue, and the other process fetching data from that message queue. Note that Message Queuing is created by creating a file, and if one process writes data to a message queue, the other process does not take out the data, even though the process of writing data to the message queue has ended, the data saved in the message queue does not disappear. That is, the next time from this message queue to read data, is the last data!!!
3) Semaphore, can not transmit complex messages, can only be used to synchronize
4) shared memory, as long as the first to create a shared memory area, other processes follow certain steps to access the data in this shared memory area, of course, can be read and write, the fastest.
Comparison of communication modes between IPC processes