Blame


1 665c255d 2023-08-04 jrmu Exercise 3.40. Give all possible values of x that can result from executing
2 665c255d 2023-08-04 jrmu
3 665c255d 2023-08-04 jrmu (define x 10)
4 665c255d 2023-08-04 jrmu
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))))
7 665c255d 2023-08-04 jrmu
8 665c255d 2023-08-04 jrmu Which of these possibilities remain if we instead use serialized procedures:
9 665c255d 2023-08-04 jrmu
10 665c255d 2023-08-04 jrmu (define x 10)
11 665c255d 2023-08-04 jrmu
12 665c255d 2023-08-04 jrmu (define s (make-serializer))
13 665c255d 2023-08-04 jrmu
14 665c255d 2023-08-04 jrmu (parallel-execute (s (lambda () (set! x (* x x))))
15 665c255d 2023-08-04 jrmu (s (lambda () (set! x (* x x x)))))