Kahn Process Networks (KPN) [1][2] are a model of concurrent computation on data streams. They combine fully parallel execution with functional determinism, i.e., independent of scheduling order, or relative processing speeds, the produced output streams are uniquely defined. This alleviates common problems in parallel programming, for instance, using threads tpbcite key=”Lee06″]. Kahn Process Networks can be implemented as a collection of sequential programs that do not share any data with each other, but, instead, communicate only by exchanging streams of data in First-In-First-Out order with blocking read operations, i.e., if a process commits to reading data from an input stream it blocks until data arrives on the input. It is not able to select input data based on the time of arrival. FIFO storage is implemented for the channels connecting processes. The FIFOs can be bounded, but only if this does not introduce deadlocks (although in general this is an undecidable problem).
Kahn Process Networks have an elegant mathematical semantics in the form of a function that maps input streams to output streams, defined as a least fixed-point of an overall network function on a complete partial order [3]. It is also useful to have an operational mathematical semantics, because it is closer to (the execution of) an implementation of a KPN. Such an operational semantics is presented in [4], and it is shown that it corresponds to the denotational semantics.
A drawback of the functional determinism of KPN is that they are prohibited from effectively responding to events, i.e., to unanticipated input, because the blocking read cannot be used for that. The Reactive Process Networks [5] model presents an extension of KPN with the ability to respond to events and to separate the event handling from the functional determinate stream processing behavior..
The operational semantics of KPN or RPN can serve as a reference to implementing KPN or RPN. The operational semantics, however, uses unbounded FIFO buffers. It is often convenient to implement FIFO buffers of a fixed size. On the other hand, determining the required size is an undecidable problem. This introduces the need for online buffer memory management and the handling of artificial deadlocks that may arise due to buffers being insufficienty large. Only if such an online memory management strategy is implements carefully, the resulting program behaves as prescribed by the semantics [6].
References
- (1974): The Semantics of a Simple Language for Parallel Programming. In: Rosenfeld, J. L. (Ed.): Information Processing 74: Proceedings of the IFIP Congress 74, Stockholm, Sweden, August 1974, pp. 471โ475, North-Holland, Amsterdam, Netherlands, 1974.
- (1977): Coroutines and Networks of Parallel Processes. In: IFIP 77, pp. 993โ998, North-Holland, Amsterdam, 1977.
- (1974): The Semantics of a Simple Language for Parallel Programming. In: Rosenfeld, J. L. (Ed.): Information Processing 74: Proceedings of the IFIP Congress 74, Stockholm, Sweden, August 1974, pp. 471โ475, North-Holland, Amsterdam, Netherlands, 1974.
- (2019): Kahn Process Networks and a Reactive Extension. In: Bhattacharyya, Shuvra S.; Deprettere, Ed F.; Leupers, Rainer; Takala, Jarmo (Ed.): Handbook of Signal Processing Systems, pp. 865โ906, Springer International Publishing, Cham, 2019, ISBN: 978-3-319-91734-4.
- (2019): Kahn Process Networks and a Reactive Extension. In: Bhattacharyya, Shuvra S.; Deprettere, Ed F.; Leupers, Rainer; Takala, Jarmo (Ed.): Handbook of Signal Processing Systems, pp. 865โ906, Springer International Publishing, Cham, 2019, ISBN: 978-3-319-91734-4.
- (2003): Requirements on the Execution of Kahn Process Networks. In: Degano, Pierpaolo (Ed.): Programming Languages and Systems, pp. 319โ334, Springer Berlin Heidelberg, Berlin, Heidelberg, 2003, ISBN: 978-3-540-36575-4.
Selected Related Publications
2019
Kahn Process Networks and a Reactive Extension Book Chapter
In: Bhattacharyya, Shuvra S.; Deprettere, Ed F.; Leupers, Rainer; Takala, Jarmo (Ed.): Handbook of Signal Processing Systems, pp. 865โ906, Springer International Publishing, Cham, 2019, ISBN: 978-3-319-91734-4.
2003
Requirements on the Execution of Kahn Process Networks Proceedings Article
In: Degano, Pierpaolo (Ed.): Programming Languages and Systems, pp. 319โ334, Springer Berlin Heidelberg, Berlin, Heidelberg, 2003, ISBN: 978-3-540-36575-4.
1977
Coroutines and Networks of Parallel Processes Proceedings Article
In: IFIP 77, pp. 993โ998, North-Holland, Amsterdam, 1977.
1974
The Semantics of a Simple Language for Parallel Programming Proceedings Article
In: Rosenfeld, J. L. (Ed.): Information Processing 74: Proceedings of the IFIP Congress 74, Stockholm, Sweden, August 1974, pp. 471โ475, North-Holland, Amsterdam, Netherlands, 1974.