Exercise3-38 <---> Exercise3-40
Exercise 3.39
Exercise 3.39. Which of the five possibilities in the parallel execution shown above remain if we instead serialize execution as follows:
(define x 10)
(define s (make-serializer))
(parallel-execute (lambda () (set! x ((s (lambda () (* x x))))))
- (s (lambda () (set! x (+ x 1)))))
a.
1. x = 10 -> 10
2. new-value = x * x -> 100
3. x = x + 1 -> 11
4. (following 2.) x = new-value -> 100
b.
1. x = 10 -> 10
2. new-value = x * x -> 100
3. x = new-value -> 100
4. x = x + 1 -> 101
c.
1. x = 10 -> 10
2. x = x + 1 -> 11
3. new-value = x * x -> 121
4. x = new-value -> 121
Exercise3-38 <---> Exercise3-40