Process communication: Shared storage, messaging, and pipeline communication

Source: Internet
Author: User
Tags mutex

Process communication refers to the exchange of information between processes. PV operation is a low-level mode of communication, high-level communication means the transmission of large amounts of data with high efficiency of the communication mode. There are three main classes of advanced communication methods.

Shared storage

There is a direct access to the communication between the process of shared space, through this piece of space to write/read operations to achieve the exchange of information between processes. When you write/read to a shared space, you need to control the write/read of the shared space using a synchronous mutex tool such as P operation and V operation. Shared storage is divided into two categories: low-level sharing is based on data structure sharing, advanced mode is based on the sharing of storage. The operating system is only responsible for providing shared storage space and synchronous mutex tools for the communication process, while the data exchange is done by the user to arrange the read/write instructions.

It is important to note that the user process space is generally independent, in order to make two user process spaces must be implemented through special system calls, while in-process threads are naturally shared process space.

Message delivery

In a messaging system, data exchange between processes is in the form of formatted messages (message). If there is no direct access to the shared space between the processes of the communication, the process communication must be implemented using the messaging method provided by the operating system. The process uses the system-provided send message and receives the message two primitives to exchange data.

1) Direct communication: The sending process sends the message directly to the receiving process and hangs it on the message buffer queue of the receiving process, receiving the message from the message buffer queue.

2) indirect means of communication: the sending process sends the message to an intermediary entity, and the receiving process obtains the message from the intermediary entity. This intermediate entity is commonly called the mailbox, this kind of communication is also called the Mailbox communication mode. The communication method is widely used in computer network, and the corresponding communication system is called e-mail system.

Pipeline communication

Pipeline communication is a special way of message passing. The so-called "pipeline" refers to a shared file that is used to connect a read process and a write process to achieve communication between them, aka pipe file. A send process (that is, a write process) that provides input to a pipeline (a shared file), sends a large amount of data into a (write) pipeline as a character stream, and receives (reads) data from the pipeline as a receive pipeline output (that is, a read process). In order to coordinate the communication between the two sides, the pipeline mechanism must provide the following three aspects of coordination ability: mutual exclusion, synchronization and determination of the other party.

Process communication: Shared storage, messaging, and pipeline communication

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.