IPC mainly includes: pipeline, Message queue, signal volume, shared memory, socket (socket).
I. Persistence of IPC objects
Each IPC mechanism uses a data structure in which an instance of the data structure is called an object of the IPC mechanism (the corresponding entity that is used to synchronize the data structure of the mutex can also be called the object of the mechanism). To clarify the persistence of the IPC object is helpful to understand the working mechanism of the corresponding IPC.
1. Object Persistence
Generally, the persistence of IPC objects can be divided into three kinds:
Process persistence: An object with this persistence disappears when the last process that holds it closes the object.
Kernel Persistence: Objects with this persistence disappear in two cases, (1) system reboot (2) it is explicitly deleted
File system Persistence: An object with this persistence disappears only if it is explicitly deleted.
The following table is a common IPC object and the persistence of the objects used to synchronize mutexes
The persistence of no object from the table is a file system. This is also reasonable because there are few processes that can be unaffected by system reboots, and the use of file system persistence may also degrade the performance of the IPC mechanism.
2. The effect of invoking Fork,exec,_exit on IPC objects and synchronization mutex objects