IT lexicon › Programming › Hold-and-wait

Hold-and-wait

Programming På svenska → Updated: 2026-11-16

One of four necessary conditions for deadlock: threads holding resources can wait for additional ones.

Deadlock requires four conditions to be true simultaneously. Hold-and-wait is the third: a thread must already have acquired some resources (locks, memory blocks, file handles) while waiting for more. If threads were forced to release all held resources before acquiring new ones, deadlock would be eliminated.

Practical defenses include lock-ordering (acquire everything at once), resource pre-allocation (reserve all upfront), or timeout. Completely eliminating hold-and-wait in a large system is often impractical.

← Back to the lexicon