Computer Science

Deadlock, explained

Deadlock is a state where tasks wait on each other forever and no task can make progress.
Back to Glossary

Part of the Semantic Notion technical glossary.

Short Definition

Deadlock is a state where tasks wait on each other forever and no task can make progress.

Intuition

Each participant holds something another participant needs, so everyone is stuck.

Technical Definition

Deadlock arises when conditions such as mutual exclusion, hold-and-wait, no preemption, and circular wait occur together.

Example

Thread A holds lock 1 and waits for lock 2 while thread B holds lock 2 and waits for lock 1.

Common Misunderstandings

Deadlock is different from slow performance.
Adding more locks can increase deadlock risk.

Start here

Need the broader concept map?

Return to the glossary index to move from this definition into adjacent AI, ML, mathematics, and computer science terms.