Peter Van Roy wrote:
Last month I posted some example code to show how to do
Functional Reactive Programming in Oz.  That code was
incomplete since it did not avoid "glitches".  For example,
in the expression (a + (a div 3)), if a new event arrives for a,
then a single new output has to be calculated.  Because of
thread scheduling, we might get a temporary wrong output
(e.g., if the + is scheduled before the div).

Here is an updated version of FRP that avoids this problem.
It correctly does global synchronization to avoid glitches.
It works as follows: when a new input event arrives, then
the computation is allowed to calculate until all its threads
suspend simultaneously.  At that point, we know that the
output is correct.  We use computation spaces to wait until
all threads suspend simultaneously.

Peter
The code needs a minor fix: the procedure Step should be defined
*after* the example, since it uses the stream Bs.

Peter


_________________________________________________________________________________
mozart-users mailing list                               
mozart-users@ps.uni-sb.de
http://www.mozart-oz.org/mailman/listinfo/mozart-users

Reply via email to