You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
388 B
19 lines
388 B
2 years ago
|
|
||
|
Exercise 3.40: Give all possible values of
|
||
|
x that can result from executing
|
||
|
|
||
|
|
||
|
(define x 10)
|
||
|
(parallel-execute
|
||
|
(lambda () (set! x (* x x)))
|
||
|
(lambda () (set! x (* x x x))))
|
||
|
|
||
|
Which of these possibilities remain if we instead use serialized procedures:
|
||
|
|
||
|
|
||
|
(define x 10)
|
||
|
(define s (make-serializer))
|
||
|
(parallel-execute
|
||
|
(s (lambda () (set! x (* x x))))
|
||
|
(s (lambda () (set! x (* x x x)))))
|