3.39 Exercise 3.39
(define x 10) (define s (make-serializer)) (parallel-execute (lambda () (set! x ((s (lambda () (* x x)))))) (s (lambda () (set! x (+ x 1)))))
These possibilities can occur:
101: The first procedure runs to completion before the second
100: The calculation of (* x x) is run first, followed by the incrementing of x and then the setting of x to 100
121: The second procedure runs to completion before the first