Deadlocks, Liveness & Reentrant Locks
Explore common concurrency pitfalls such as deadlocks, livelocks, and starvation, and understand how reentrant locks work in Java. This lesson helps you identify and resolve multithreading issues to improve program reliability and progress.
We'll cover the following...
Logical follies committed in multithreaded code, while trying to avoid race conditions and guarding critical sections, can lead to a host of subtle and hard to find bugs and side-effects. Some of these incorrect usage patterns have their names and are discussed below.
DeadLock
Deadlocks occur when two or more threads aren’t able to make any progress because the resource required by the first thread is held by the second and the resource required by the second thread is held by the first.
Liveness
Ability of a program or an application to execute in a timely manner is called liveness. If a program experiences a deadlock then it’s not exhibiting liveness.
Live-Lock
A live-lock occurs when two threads ...