Java Reference
In-Depth Information
locks held. Using open calls to avoid deadlock is analogous to using encapsulation to provide
thread safety: while one can certainly construct a thread-safe program without any encapsu-
lation, the thread safety analysis of a program that makes effective use of encapsulation is far
easier than that of one that does not. Similarly, the liveness analysis of a program that relies
exclusively on open calls is far easier than that of one that does not. Restricting yourself to
open calls makes it far easier to identify the code paths that acquire multiple locks and there-
fore to ensure that locks are acquired in a consistent order. [3]
Search WWH ::




Custom Search