283
edits
KalmanKeri (talk | contribs) |
KalmanKeri (talk | contribs) |
||
| Line 113: | Line 113: | ||
=== The pipe combinator === | === The pipe combinator === | ||
After discussing sequence and choice, the pipe combinator is the first where communication occurs between processes. | |||
<math>s \rhd t</math> is a composite process that enforces unidirectional flow | <math>s \rhd t</math> is a composite process that enforces unidirectional data flow between its components according to the following diagram. | ||
<math> | <math>\underset{s \rhd t}{\boxed{\to \boxed{s} \to \boxed{t} \to}}</math> | ||
Compared to the parallel composition <math>\mid</math> in [[Wikipedia:π-calculus|π-calculus]], <math>\rhd</math> can be classified as unidirectional parallel composition. | Compared to the parallel composition <math>\mid</math> in [[Wikipedia:π-calculus|π-calculus]], <math>\rhd</math> can be classified as unidirectional parallel composition. | ||
| Line 123: | Line 123: | ||
Synchronisation and communication | Synchronisation and communication | ||
==== Pipe and Unix pipelines ==== | |||
A [[Wikipedia:Pipeline_(Unix)|pipeline]] in Unix shell programming is a good analogy for the pipe combinator. Piped programs execute concurrently. It cannot occur that in <math>P1 | P2</math> the output of <math>P1</math> directly reaches the output of the pipeline. | |||
It is an essential difference though that Unix processes can handle more than one input and output streams, and only the standard input and output streams are passed on through the pipe. Another difference is the degree of concurrency. Race conditions can't occur between pipe-calculus processes unlike between OS level processes<ref>That's why I prefer the term ''cooperation'' to describe the interdependencies of pipe-calculus processes.</ref>. | |||
==== Recognition and interpretation ==== | ==== Recognition and interpretation ==== | ||
One can also think of <math>s \rhd t</math> in a syntactic setting. In this case <math>s</math> represents ''input'' or ''source'', while <math>t</math> plays the role of a ''recognizer'', ''parser'' or ''interpreter''. | |||
== Formal Definition == | == Formal Definition == | ||
edits