...

/

Deadlocks, Liveness & Reentrant Locks

Deadlocks, Liveness & Reentrant Locks

We discuss important concurrency concepts such as deadlock, liveness, live-lock, starvation, and reentrant locks in depth. Also included are executable code examples for illustrating these concepts.

We'll cover the following...

Deadlock and Liveness

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 specific 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

The ability of a program or an application to execute in a timely manner is called liveness. If a program ...