Embedded Systems & Firmware

Which describes priority inversion in an RTOS?

  1. 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
  2. BA bug where priority numbers are interpreted backwards
  3. 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.
Practice this topic Back to topic

More Embedded Systems & Firmware questions

  1. Which describes priority inheritance, used to prevent priority inversion?
  2. In an RTOS, what is the advantage of using a queue (message queue) to pass data from a sensor-reading task to a display task?
  3. What is the difference between hard real-time and soft real-time?
  4. Why is it bad practice to kick (reset) the watchdog timer unconditionally inside a 1 ms timer interrupt handler?
  5. What is the role of a bootloader in an embedded device?