Techniques of inter-process communication----pipeline and FIFO usage

Source: Internet
Author: User

1. Creation of Pipelines1.1 mkfifo (const char *pathname,mode_t mode);The function has been implicitly specified o_creat| O_EXCL, so it either creates a new FIFO, or returns a eexist error (already present). so in creating a pre-existing FIFO or a new FIFO, you should call Mkfifo and check if the return value is a eexist error, or the Open function if the eexist error. 2.FIFO or pipe reading and writing2.1 write to a pipeline or FIFO always adds data to the end, and read from the pipeline or FIFO is always reading from the beginning. Returns espipe error if Lseek is called on a pipe or FIFO2.2 interprocess Communication note the order of the read-write pipeline to prevent deadlocks. 3. piping or FIFO the deletionafter the pipeline---process is closed, it disappears automatically. FIFO---Called unlink removed from the file system. 4. Atomic operation of pipelines or FIFOAtomic Write Property <=pipe_buf (pipe buffer size) for writes to a pipeline or FIFO, regardless of other properties5 interprocess communicationThe write process closes the pipe or FIFO message through the Read () Return file end descriptor to the reading process. The read process closes a pipeline or FIFO message by passing a signal to the write process.



Techniques of inter-process communication----pipeline and FIFO usage

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.