Please enable JavaScript.
Coggle requires JavaScript to display documents.
Avoiding Liveness Hazards - Coggle Diagram
Avoiding Liveness Hazards
Tension Between Safety and Liveness
Safety
Achieved through locking
Risk: Indiscriminate locking → lock-ordering deadlocks
Liveness
Achieved through thread pools and semaphores
Risk: Poor understanding of bounded activities → resource deadlocks
Deadlock in Java Applications
Java apps do not recover from deadlocks
Design should preclude deadlock conditions
Liveness Failures
Serious because they are non-recoverable (except by aborting the app)
Most common: Lock-ordering deadlock
Avoiding Lock-Ordering Deadlocks
Begins at design time
Rule: Acquire multiple locks in a consistent order
Best practice: Use open calls
Reduces places with multiple locks held
Makes such places more obvious