CS 102 (Spring 2003)
Quiz 3: Exclusion
Given in class
Three approaches for exclusion:
Eliminate the need through immutability
What causes deadlock?
How can deadlock be avoided through resource ordering?
For thread-shared storage, what properties are of interest for correctness of concurrent programs?
Atomicity -- what is guaranteed and what must be provisioned by the programmer?
Visibility -- when are shared-variables updated?
Instruction ordering -- on what can you depend?
What conditions are necessary for method confinement of an object?
Puzzler: Given a Set s, how would you write a class
, so that you could write:
The above line would hold a lock on every Object in
and only then run the supplied Runnable.
Last modified 11:49:34 CST 20 February 2003 by
Ron K. Cytron