UNIX Environment Advanced Programming: IPC Summary

Source: Internet
Author: User
Tags file system message queue mutex socket

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.