Java Concurrency - Deadlock

> Procedural Languages > Java > Java - Concurrency (Parallel Work)

1 - About

deadlock in Java.

The Java programming language neither prevents nor requires detection of deadlock conditions.

Programs where threads hold (directly or indirectly) locks on multiple objects should use conventional techniques for deadlock avoidance, creating higher-level locking primitives that do not deadlock, if necessary.


3 - Example

4 - Management

4.1 - Detection

See Thread dump deadlock detection rapport

Minimal Example:

jstack -F PID
Attaching to process ID 24060, please wait...
Debugger attached successfully.
Server compiler detected.
JVM version is 25.171-b11
Deadlock Detection:

No deadlocks found.

5 - Documentation / Reference