# Coprocess

> Mediated Wiki article. Canonical URL: https://mediated.wiki/source/Coprocess
> Markdown URL: https://mediated.wiki/source/Coprocess.md
> Source: https://en.wikipedia.org/wiki/Coprocess
> Source revision: 1301347773
> License: Creative Commons Attribution-ShareAlike 4.0 International (https://creativecommons.org/licenses/by-sa/4.0/)

In [computer science](/source/computer_science), a '''coprocess''' is a [process](/source/process_(computer_science)) that explicitly yields control to other processes or the operating system.

In [Unix](/source/Unix), a '''coprocess''' is a process that sends its output solely to the exact single process from which it solely received input.

[Bash](/source/Bash_(Unix_shell)), [BETA](/source/BETA_(programming_language)), [ksh](/source/KornShell), and [Zsh](/source/Z_Shell)<ref name="zsh-man">{{cite web |title=6.1 Simple Commands & Pipelines |url=https://zsh.sourceforge.io/Doc/Release/Shell-Grammar.html#Simple-Commands-_0026-Pipelines |edition=Version 5.9 |website=The Z Shell Manual |access-date=13 July 2025 |date=14 May 2022 |quote=If a pipeline is preceded by ‘coproc’, it is executed as a coprocess; a two-way pipe is established between it and the parent shell. The shell can read from or write to the coprocess by means of the ‘>&p’ and ‘<&p’ redirection operators or with ‘print -p’ and ‘read -p’. A pipeline cannot be preceded by both ‘coproc’ and ‘!’. If job control is active, the coprocess can be treated in other than input and output as an ordinary background job.}}</ref> have language constructs for coprocesses.

== See also ==

* [Deterministic concurrency](/source/Deterministic_concurrency)

==References==
{{reflist}}

== External links ==

* [https://www.gnu.org/software/bash/manual/html_node/Coprocesses.html Coprocesses] definition in Bash Reference Manual

Category:Process (computing)
Category:Concurrent computing

{{Prog-lang-stub}}

---
Adapted from the Wikipedia article [Coprocess](https://en.wikipedia.org/wiki/Coprocess) by Wikipedia contributors ([contributor history](https://en.wikipedia.org/wiki/Coprocess?action=history)). Available under [Creative Commons Attribution-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-sa/4.0/). Changes may have been made.
