Linux Study Notes (7)-Linux general technology-Linux programming and kernel information. The following is a detailed description. 11. elementary learning of Pipelines
MPs queue-special files, which are independent and only exist in memory
-- Process generated by the same process (Same Origin)
-- Half-duplex communication is adopted. Only one party can transmit data at a time.
Low-level MPs queue
Use the pipe function to create a low-level pipeline. After the pipeline is created, two file descriptors, pipe_fd [0] And pipe_fd [1], are generated. Pipe_fd [0] is used to read data from the pipeline, and pipe_fd [1] is used to write data to the pipeline (read and write functions are used to read and write data ).
Pipeline Data Flow Diagram
[Table = 98%] [tr] [td] MPs queue
[/Td] [/tr] [/table]
Common functions in pipeline operations
Pipe
Create an unknown MPs queue
Popen
Create a standard Stream pipeline
Mkfifo
Determine whether to detect or change the signal shielding word
Pipe Function Description
[Table] [tr] [td = 115,] function header file
[/Td] [td = 453,] # include
[/Td] [/tr] [tr] [td = 115,] function prototype
[/Td] [td = 1,1, 453] int
Pipe (int files [2])
[/Td] [/tr] [tr] [td = 115,] function return value
[/Td] [td = 453,] 0 is returned for successful execution, and-1 is returned for unsuccessful execution
[/Td] [/tr] [/table] programming: To design a program, you must create a pipeline, copy the process, write data to the parent process, and read data from the child process.
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