Introduction to Linux interprocess communication (IPC)

Source: Internet
Author: User
Tags mutex posix

development of the Linux IPC

The process communication methods under Linux are basically inherited from the process communication methods on the UNIX platform. The two main players at T - Lab and BSD(UC Berkeley's Berkeley Software Release Center), which have made significant contributions to the development of UNIX, have a different focus on inter-process communication. The former is a systematic improvement and expansion of the inter-process communication means of UNIX, which forms "system V IPC", whose communication process is confined to a single computer, while BSD skips the limit, which forms a socket-based interface (socket) . Inter-process communication mechanism. Linux, in turn, has inherited both advantages.

Inter-process communication includes

The UNIX inter-process communication (IPC) approach includes pipelines, FIFO, and signals.

System V interprocess communication (IPC) includes system V Message Queuing, System V semaphores, and the System V shared memory area.

POSIX interprocess communication (IPC) includes POSIX Message Queuing, POSIX semaphores, and POSIX shared memory areas.

About POSIX

POSIX represents a portable operating system interface (Portable Operating system Interface, abbreviated as POSIX), and the POSIX standard defines the interface standards that the operating system should provide for applications. is the generic term for the series of API standards that IEEE defines for software to run on a variety of UNIX operating systems, formally referred to as IEEE 1003, and the International standard name is ISO/IEC 9945.

The POSIX standard is intended for software portability at the source code level . In other words, a program written for a POSIX-compliant operating system should be compiled and executed on any other POSIX operating system, even from another vendor.

POSIX is not limited to UNIX. Many other operating systems, such as DEC OpenVMS, support POSIX standards, especially IEEE STD. 1003.1-1990 (1995 revision) or POSIX.1,POSIX.1 provides a source-level C Language Application Programming Interface (API) to the operating system Programs, such as read-write files. POSIX.1 has been accepted by the International Organization for Standardization (International standards Organization,iso) and is named ISO/IEC 9945-1:1990 standard.

About POSIX2

The birth of POSIX and the development of UNIX are inseparable, the Institute of Electrical and Electronics Engineers (Institute of Electrical and Electronics engineers,ieee) originally developed the POSIX standard to improve UNIX Portability of applications under the environment. Unix was born in the 70 's Bell Labs, and in the 80 's to the United States major universities to distribute V7 version of the source code to do research. The University of California, Berkeley, developed BSD Unix on the basis of V7. Later, many commercial manufacturers realized that Unix's value had been developed on the basis of Bell Labs ' System V or BSD, a more famous sun Os,aix,vms.

POSIX has evolved into a very large standard family, and some parts are in the process of development. POSIX standards with IEEE 1003 and 2003 families are interchangeable.

The Windows nt-based system does not directly support the new POSIX interface, only the first version of the POSIX v1:iso/iec9945-1:1990[1] Edition standard. Because Windows nt-based systems that only support the first version of POSIX cannot create threads and forms that comply with POSIX interface standards, Microsoft provides the POSIX-compliant layer of the Microsoft POSIX subsystem software package (Windows Services for UNIX) to support the new POSIX interface, Windows systems can also run other POSIX compatibility layers such as Cygwin.

Inter-process Communication classification

Q File

Q File Lock

Q Pipeline (pipe) and well-known management (FIFO)

Q Signal (signal)

Q Message Queuing

Q Shared Memory

Q Signal Volume

Q Mutex Amount

Q Condition Variable

Q Read/write lock

Q socket (socket)

System V IPC & POSIX IPC

System V IPC

System V Message Queuing

System V Shared Memory

System V Signal Volume

POSIX IPC

Message Queuing

Shared memory

Signal Volume

Mutex Amount

Condition variable

Read/write Lock

ways to share information among processes

The persistence of IPC objects

With process persistence: persists until the last process that is opened ends. (such as pipe and FIFO (process end, data deletion))

Persistent with kernel: persists until kernel bootstrap or explicit deletion (such as System V Message Queuing, shared memory, semaphores)

Persists with file system: persists until explicitly deleted , even if kernel bootstrap exists. (POSIX Message Queuing, shared memory, semaphore if it is implemented using a mapping file )

[IPC objects are managed by the Linux kernel]

Introduction to Linux interprocess communication (IPC)

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.