Keeping Your Priorities Straight
Priorities must be handled carefully when there are dependencies among tasks with different priorities.
- A task with priority P should never impede the progress of a task with priority Q > P.
This is called priority inversion, and it is to be avoided.
- The basic solution is some form of priority inheritance.
When a task with priority Q waits on some resource, the holder (with priority P) temporarily inherits priority Q if Q > P.
Inheritance may also be needed when tasks coordinate with IPC.
- Inheritance is useful to meet deadlines and preserve low-jitter execution, as well as to honor priorities.