Priority inheritance makes the kernel temporarily raise the priority of a task that holds a mutex to match the highest-priority task currently blocked waiting on that mutex. So in the classic scenario, the moment the High task blocks on the mutex held by Low, the kernel boosts Low to High's priority. Now medium-priority tasks can no longer preempt Low, because Low is (temporarily) running at High's priority, so Low keeps the CPU, races through its critical section, and releases the mutex quickly; at that point Low drops back to its real priority and High immediately acquires the mutex and runs. The effect is to convert unbounded inversion back into bounded inversion: High still waits, but only for the critical-section duration, not for arbitrary medium-priority work. This is exactly the fix that was uploaded to Mars Pathfinder. The key implementation point for an interview is that this is why you protect shared resources with a mutex rather than a plain binary semaphore, FreeRTOS mutexes implement priority inheritance, while bare semaphores do not, so guarding a resource with a semaphore leaves you exposed to unbounded inversion. Inheritance bounds the blocking; it doesn't make it zero, so you still account for one critical section of blocking in your timing analysis.
RTOS & Real-Time Concepts · Interview question
How does priority inheritance solve priority inversion?
A strong answer
What a weak answer sounds like
You know the answer. Do you know what gets you dinged?
Pro breaks down the answer most candidates actually give to this question — and the specific reason an interviewer marks it down. It’s the difference between sounding correct and sounding senior, on all 472 questions.
From the lesson
Priority Inversion
When a high-priority task is stuck behind a low-priority one, and a medium task makes it unbounded. The classic Mars Pathfinder bug, and the fix: priority inheritance (and ceilings).
More Priority Inversion questions
Explain priority inversion with a concrete scenario.What's the difference between bounded and unbounded priority inversion?What is the priority ceiling protocol and how does it differ from inheritance?You protected a shared resource with a binary semaphore and a high-priority task occasionally misses its deadline. What's likely wrong?
Browse all 472 interview questions