Embedded Systems & Firmware
Which describes priority inversion in an RTOS?
- AWhile a high-priority task waits for a resource held by a low-priority task, a medium-priority task preempts the low one and keeps running, so the high task waits a long time
- BA bug where priority numbers are interpreted backwards
- CA rule that high-priority tasks always run after low-priority ones
Show answer and explanation
Answer: A. While a high-priority task waits for a resource held by a low-priority task, a medium-priority task preempts the low one and keeps running, so the high task waits a long time
If a high-priority task waits for a mutex held by a low-priority task, it must wait until the low task releases it. If an unrelated medium-priority task then starts running, it preempts the low task, which cannot release the resource, so in effect the high task is held up by the medium task. On the Mars Pathfinder lander in 1997, this caused repeated system resets.
- A. Correct. It famously troubled a Mars lander in 1997.
- B. It is not a misinterpretation of numbers.
- C. There is no such rule.