Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Pipeline (Unix)
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Creating pipelines programmatically== Pipelines can be created under program control. The Unix <code>pipe()</code> [[system call]] asks the operating system to construct a new [[anonymous pipe]] object. This results in two new, opened file descriptors in the process: the read-only end of the pipe, and the write-only end. The pipe ends appear to be normal, anonymous [[file descriptor]]s, except that they have no ability to seek. To avoid [[Deadlock (computer science)|deadlock]] and exploit parallelism, the Unix process with one or more new pipes will then, generally, call <code>[[fork (system call)|fork()]]</code> to create new processes. Each process will then close the end(s) of the pipe that it will not be using before producing or consuming any data. Alternatively, a process might create new [[pthreads|threads]] and use the pipe to communicate between them. ''[[Named pipe]]s'' may also be created using <code>mkfifo()</code> or <code>[[mknod]]()</code> and then presented as the input or output file to programs as they are invoked. They allow multi-path pipes to be created, and are especially effective when combined with standard error redirection, or with <code>[[tee (command)|tee]]</code>.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)