The talk analyses origins and sources of deadlocks in enterprise applications. I discuss various situations when deadlock might appear and give my recepts of resolving this situations: detect, tackle and protect corporate application from degrading. Following topics will be covered:
- Synchronization in Java: where deadlock comes from. Types of deadlocks: recursive, mutual, circuitous.
- Basic rules to avoid deadlock: lock hierarchy, foreign code prevention.
- Why deadlocks are unavoidable in corporate applications: variety of resources, a lot of foreign code, dynamic scenarios violating lock hierarchy.
- Avoiding deadlocks by reducing usage of ‘synchronized’: ‘volatile’, nonblocking algorithms, ‘java.util.concurrent’ etc.
- Detecting deadlocked threads and objects in corporate application: alive requests, update counters, heartbeats.
- Testing approaches to detect deadlocks: proper automation with realistic/stochastic profile.