Glossary · Automation software engineering and architecture
Priority inversion
German: Prioritätsinversion
In real-time systems, priority inversion is a situation in which a high-priority task waits for a resource held by a low-priority task, while medium-priority tasks preempt the low-priority task and thus indirectly delay the high-priority task.
- Software engineering
In one sentence
Priority inversion occurs when a high-priority task waits on a resource held by a low-priority task that medium-priority tasks keep preempting.
Example
A communication task of medium priority keeps running while the low-priority task holding a shared buffer cannot finish, so the high-priority control task misses its deadline.
How it applies
- Engineering: Unbounded priority inversion can make a high-priority task miss deadlines unpredictably. Countermeasures are Priority inheritance, priority ceiling protocols, or avoiding shared resources between tasks of very different priorities.
- Verification: The effect is timing-dependent and rarely shows in short tests. Timing analysis and trace tools that record task switches reveal it.
- Documentation: Where users can create tasks and assign priorities, as in many PLC runtimes, the manual should warn against sharing data in ways that cause inversion and explain the recommended mechanisms.
Priority inversion vs. deadlock
In priority inversion, the system still progresses; the high-priority task is delayed. In a Deadlock, tasks wait for each other in a cycle and none of them progresses.