What is deadlock? How can I eliminate it? Deadlock is one of the four particular hazards facing designers of multithreaded programs. The four hazards are: race, deadlock, livelock, and starvation. All four conditions cannot be eliminated merely by testing. Testing may indicate the presence of a deadlock, but it cannot be relied upon to indicate freedom from deadlock. This must happen by good design. A clear model that aids good design is CSP or Communicating Sequential Processes (invented by Tony Hoare, who also invented monitors). CSP is a language for describing patterns of interaction. It is supported by an elegant, mathematical theory, a set of proof tools, and an extensive literature. Recent theoretical work has proven that CSP can be used completely reliably in Java. Doug Lea’s book describes JCSP, one of the two libraries through which this is achieved. Using JCSP (or CTJ, the other library), it is possible to design Java programs of any complexity that are provably free from deadlock, livelock, race or starvation. The following solutions must be applied to your particular
needs; sometimes it will be impossible to use one or more of them:
Unix Books :-
Return to : - Unix System Administration Hints and Tips (c) www.gotothings.com All material on this site is Copyright.
|