Section: IT & Technology · Operating SystemsDifficulty: Advanced

Deadlock

USUK

A situation where two or more processes are each waiting for resources held by the others, causing permanent blocking.

Definition

A deadlock is a situation in concurrent computing where two or more processes are each waiting for a resource held by another process in the set, creating a circular dependency that prevents all processes from proceeding. Deadlocks require four conditions: mutual exclusion, hold and wait, no preemption, and circular wait. Prevention strategies include resource ordering, lock timeouts, and deadlock detection algorithms. Database deadlocks occur when transactions lock rows needed by each other.

Example

Process A holds Lock 1 and waits for Lock 2; Process B holds Lock 2 and waits for Lock 1 — both are stuck permanently in a deadlock.

Synonyms

  • circular dependency
  • resource lock cycle
  • thread deadlock

Antonyms / Opposites

  • livelock resolution
  • lock-free execution

Images

CC-licensed · free to use
More on Wikimedia
Loading images…

Video

  • thread
  • mutex
  • concurrency
  • starvation

Dictionary Entry

Back to IT & Technology