Video – Finding and Solving Deadlocks in Multi-Threaded Java Code by Heinz Kabutz
22.08.2012.
Heinz Kabutz o Deadlocksima u tri nastavka (detalji niže)
Finding and Solving Deadlocks in Multi-Threaded Java Code – Part 1 of 3 from Heinz Kabutz on Vimeo.
Finding and Solving Deadlocks in Multi-Threaded Java Code – Part 2 of 3 from Heinz Kabutz on Vimeo.
Finding and Solving Deadlocks in Multi-Threaded Java Code – Part 3 of 3 from Heinz Kabutz on Vimeo.
In this workshop by ExitCertified, we looked at how we avoid liveness hazards, how we find them and how we test that they are truly gone. You will learn several new unpublished techniques that will help you become more of a concurrency specialist. Material is from our new Concurrency Specialist Course. You are welcome to share this with your friends in industry.
After the lecture was done, we also spent time doing an exercise and we had some interesting questions and discussions by the participants of the workshop.
Here is the outline of the workshop:
10 Avoiding Liveness Hazards
* 10.1 Deadlock
o The drinking philosophers
o Causing a deadlock amongst philosophers
o Resolving deadlocks
o Discovering deadlocks
o Lock-ordering deadlocks
o Defining a global ordering
o Dynamic lock order deadlocks
o Defining order on dynamic locks
o Checking whether locks are held
o Imposing a natural order
o Deadlock between cooperating objects
o Open calls and alien methods
+ Example in Vector
o Resource deadlocks
o Thread-starvation deadlocks
* 10.2 Avoiding and diagnosing deadlocks
o Avoiding multiple locks
o Using open calls
o Unit testing for lock ordering deadlocks
o Adding a sleep to cause deadlocks
o Verifying thread deadlocks
o Timed lock attempts
o “TryLock” with synchronized
o Deadlock analysis with thread dumps
o Stopping deadlock victims
o DeadlockArbitrator
* 10.3 Other liveness hazards
o Starvation
+ ReadWriteLock in Java 5 vs Java 6
+ Detecting thread starvation
o Poor responsiveness
o Livelock