Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
language:langs:dflow [2020/08/09 11:45] rajit [Controlled merge] |
language:langs:dflow [2021/06/02 12:04] rajit [Examples] |
||
---|---|---|---|
Line 112: | Line 112: | ||
</ | </ | ||
Note that this introduces an arbiter. | Note that this introduces an arbiter. | ||
+ | |||
+ | Often it is helpful to know what decision was made by the arbiter. To support this, we permit an optional second channel on the right hand side of the dataflow expression as follows: | ||
+ | < | ||
+ | dataflow { | ||
+ | {|} I0, I1 -> O, c | ||
+ | } | ||
+ | </ | ||
+ | For each output generated, the control channel '' | ||
+ | |||
+ | ===== Sink ===== | ||
+ | |||
+ | A dataflow sink simply receives and discards a token from a channel. Sinks are not needed in general, since the channel that corresponds to the sink can be optimized away by an implementation. However, sinks can be useful when a particular process is re-used in a context when one of its outputs is not used. The syntax is the following: | ||
+ | < | ||
+ | dataflow { | ||
+ | c -> * | ||
+ | } | ||
+ | </ | ||
+ | The values received on '' | ||
====== Examples ====== | ====== Examples ====== | ||
Line 139: | Line 157: | ||
} | } | ||
</ | </ | ||
+ | |||
+ | ====== Clusters and Ordering ====== | ||
+ | |||
+ | It can be convenient to group dataflow elements into clusters. The syntax for grouping dataflow elements is: | ||
+ | |||
+ | < | ||
+ | dataflow { | ||
+ | ... | ||
+ | | ||
+ | a + b -> c; | ||
+ | a - b -> d | ||
+ | } | ||
+ | ... | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | |||