Introduce cardinality annotations
-
0:1
(e.g., aClock
) 1:1
-
1:n
(e.g., aDirectory2FilesReader
) m:n
- ...
Can help in choosing the optimal pipe implementation between two stages.
For example, consider two stages a
and b
where a
produces at most 1 element per execution and b
consumes at most 1 element per execution.
Let us assume that both stages are executed by the same thread.
Then, a pipe that connects both stages with each other does not need to be buffered.
Thus, in this case the optimal pipe implementation is an unbuffered and unsynchronized one.
?(a)1 ---> 1(b)?