$linuxjunkies
>

deadlock

also: circular wait, resource deadlock

A situation where two or more processes are blocked indefinitely, each waiting for a resource held by another, preventing any of them from proceeding.

A deadlock occurs when processes become stuck in a circular wait pattern. Each process holds a resource that another process needs, and each is waiting for a resource held by the other, creating an impossible dependency loop that cannot be automatically resolved.

Classic example: Process A locks File 1 and waits for File 2. Process B locks File 2 and waits for File 1. Neither can proceed because each is blocked waiting for the other to release its lock.

Deadlocks can occur with mutexes, semaphores, file locks, or any shared resource. The kernel cannot automatically break deadlocks, so they must be prevented through careful resource allocation, timeout mechanisms, or lock ordering strategies.

Related terms