Glossary · Automation software engineering and architecture
Deadlock
German: Verklemmung
In concurrent systems, a deadlock is a situation in which two or more tasks, threads or processes are permanently blocked because each is waiting for a resource or event held by another, so none of them can proceed.
- Software engineering
In one sentence
A deadlock occurs when tasks wait for resources held by each other, so none of them can ever proceed.
Example
The HMI task locks the recipe table and waits for the alarm buffer, while the alarm task locks the alarm buffer and waits for the recipe table; both stop responding.
How it applies
- Engineering: Deadlocks require four conditions: mutual exclusion, holding while waiting, no preemption of resources and circular waiting. Breaking any one prevents them; the most practical rule is to acquire locks in a fixed global order.
- Operation: A deadlocked task stops without crashing, which makes the fault hard to spot. Watchdogs, Timeout handling on lock acquisition and health monitoring help detect it. The term also applies to material flow, for example when two transfer systems each wait for the other to clear a position.
- Documentation: Document locking order rules and shared resources in developer documentation. In machine documentation, describe how to recover from blocked material flow situations safely, if the design cannot rule them out.
Deadlock vs. livelock
In a deadlock, tasks are blocked and do nothing. In a Livelock, tasks keep running and changing state but still make no progress, for example by repeatedly backing off from each other. Livelocks can be harder to detect, because the system looks active.