Embedded Systems & Firmware

Which describes priority inheritance, used to prevent priority inversion?

  1. ALower the high-priority task to the low task's priority
  2. BGive all tasks the same priority
  3. CTemporarily raise the low-priority task holding a resource to the priority of the high-priority task waiting for it
Show answer and explanation

Answer: C. Temporarily raise the low-priority task holding a resource to the priority of the high-priority task waiting for it

With priority inheritance, when a high-priority task starts waiting for a mutex held by a low-priority task, the low task temporarily gets the high task's priority. It then proceeds without being preempted by medium tasks and returns to its original priority on releasing the resource. The high task waits only for the short time the low task uses the resource. Many RTOS mutexes provide this feature.

  • A. That would delay the high task even more.
  • B. Priority would lose its meaning.
  • C. Correct. It can release the resource without being preempted by medium tasks.
Practice this topic Back to topic

More Embedded Systems & Firmware questions

  1. 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?
  2. What is the difference between hard real-time and soft real-time?
  3. Why is it bad practice to kick (reset) the watchdog timer unconditionally inside a 1 ms timer interrupt handler?
  4. What is the role of a bootloader in an embedded device?
  5. In devices updated over the air (OTA), why is flash divided into two firmware slots (A and B)?