Reference: http://www.cnblogs.com/xuechao/archive/2011/12/05/2277180.html
Table 1. inter-process communication in UNIX
name |
description |
range |
purpose |
file |
read and write data in a typical UNIX file. Any number of processes can interoperate. |
Local |
share a large dataset |
MPs queue |
use a dedicated file descriptor to transmit data between two processes. Communication is only performed between the parent process and the child process. |
Local |
simple data sharing, such as producer and consumer |
Named Pipe |
exchange data between processes through a dedicated file descriptor. Communication can be performed between any two peer processes on the same host. |
Local |
producer and consumer or command-control, such as MySQL and its command line query tool |
signal |
interrupt notification application Program . |
Local |
unable to transmit data in the signal, so the signal is mainly used for process management |
shared memory |
Read and Write Data sharing information in the same memory segment. |
Local |
any type of collaboration is especially suitable for scenarios requiring security |
socket |
after the special setting process is completed, data is transmitted using normal input/output operations. |
local or remote |
FTP, ssh, Apache Web server, and other network services |
As mentioned above, each technology meets different needs. Assuming that the collaboration between multiple processes is generally quite complex, the advantages and disadvantages of each method are as follows:
End