RTOS & Real-Time Concepts · Interview question

What's the difference between bounded and unbounded priority inversion?

A strong answer

Bounded priority inversion is the unavoidable delay any time a high-priority task needs a resource currently held by a lower-priority task: the high task must wait for the holder to finish its critical section and release the resource, and that wait is bounded by the length of the critical section, short, predictable, and something you can account for. Unbounded priority inversion is when that wait gets extended arbitrarily because medium-priority tasks (which don't need the resource) preempt the low-priority holder while it's in the critical section, so the holder can't finish and release; the high task's blocking time is now bounded only by how much medium-priority work happens to run, which is effectively unbounded and unpredictable. The goal of the fixes isn't to eliminate blocking, sharing a resource inherently means sometimes waiting for it (bounded inversion), it's to prevent the unbounded case so the worst-case blocking stays equal to the critical-section length and can be included in schedulability analysis. So bounded is acceptable and analyzable; unbounded is the real-time-killing bug.

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

Browse all 472 interview questions
What's the difference between bounded and unbounded priority inversion? | EmbeddedPrep.io