The shared memory zone is the fastest available IPC format. Once such a memory zone is mapped to the address space of the process sharing it, the data transmitted between these processes is no longer transferred to each other by executing any system call into the kernel, saving time.
The differences between shared memory and message queue, FIFO, and message transmission in pipelines are as follows:
The latter, message queue, FIFO, and pipeline message transmission methods are generally
1: The server receives the input
2: Data is written to a message queue through an MPS queue, which usually needs to be copied from the process to the kernel.
3: the customer copies the data from the kernel to the process.
4: then copy the file from the process to the output file.
The above process usually takes four copies to complete file transfer.
The shared memory only needs
1: from the input file to the shared memory area
2: output from the shared memory area to the file
The above process does not involve kernel copying, so it takes less time.
Http://bbs.chinaunix.net/thread-2020589-1-1.html