21.4 State and Indeterminism

We have said that a port is a stateful data structure. It is stateful since it gives access to the actual ``end'' of a stream which changes over time. It should be noted that state introduces indeterminism. This means the the result of a computation is not uniquely determined by its inputs. For instance, the final stream obtained by merging two other streams is indeterministic.

In general, state is important for concurrent programming. However, state renders concurrent programming also difficult, since the indeterminism it raises has to be controlled. For instance, if two processes compete for the same resource then only the process who comes first is served.


Denys Duchier, Claire Gardent and Joachim Niehren
Version 1.3.99 (20050412)