How the process is communicated

Source: Internet
Author: User
Tags message queue posix semaphore

Turn from: http://blog.csdn.net/chen825919148/article/details/8146128

How processes are communicated (1) pipelines (Pipe): Pipelines can be used for communication between relational processes, allowing one process to communicate with another process that has a common ancestor.
(2) Named pipe (named pipe): The named pipe overcomes the restriction that the pipe has no name, so it allows communication between unrelated processes in addition to the functionality that the pipe has. Named pipes have corresponding file names in the file system. Named pipes are created by command Mkfifo or system call Mkfifo.
(3) signal (Signal): signal is a more complex means of communication, used to inform the acceptance process has some kind of event, in addition to communication between processes, the process can also send signals to the process itself; Linux in addition to supporting the UNIX early signal semantic function Sigal outside, It also supports the signal function sigaction of semantics conforming to POSIX.1 standard (in fact, the function is based on BSD, BSD in order to achieve reliable signal mechanism, but also can unify the external interface, with the Sigaction function to realize the signal function).
(4) Message queue: Message Queuing is a linked table of messages, including POSIX Message Queuing system V Message Queuing. A process with sufficient permissions can add messages to the queue, and processes that are given Read permission can read messages in the queue. Message Queuing overcomes the lack of signal-carrying information, the pipeline can only host unformatted byte streams, and the buffer size is restricted.
(5) Shared memory: Allows multiple processes to access the same memory space, is the fastest available IPC form. is designed for the low efficiency of other communication mechanisms. It is often used in conjunction with other communication mechanisms, such as semaphores, to achieve synchronization and mutual exclusion between processes.
(6) Memory mapping (mapped memory): Memory mappings allow any number of interprocess communications, and each process that uses the mechanism implements it by mapping a shared file to its own process address space.
(7) Semaphore (semaphore): primarily as a synchronization between processes and different threads of the same process.
(8) Socket: A more general interprocess communication mechanism that can be used for interprocess communication between different machines. Originally developed by the BSD branch of the UNIX system, it is now generally possible to migrate to other Unix-like systems: Linux and System V variants support sockets.

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.