1 665c255d 2023-08-04 jrmu ;; Exercise 3.40. Give all possible values of x that can result from executing
3 665c255d 2023-08-04 jrmu (define x 10)
5 665c255d 2023-08-04 jrmu (parallel-execute (lambda () (set! x (* x x)))
6 665c255d 2023-08-04 jrmu (lambda () (set! x (* x x x))))
8 665c255d 2023-08-04 jrmu ;; 10^2, 10^3, 10^4, 10^5, 10^6
10 665c255d 2023-08-04 jrmu ;; Which of these possibilities remain if we instead use serialized procedures:
12 665c255d 2023-08-04 jrmu (define x 10)
14 665c255d 2023-08-04 jrmu (define s (make-serializer))
16 665c255d 2023-08-04 jrmu (parallel-execute (s (lambda () (set! x (* x x))))
17 665c255d 2023-08-04 jrmu (s (lambda () (set! x (* x x x)))))