Priority inversion is a problem that occurs in some systems when a high-priority task (thread or process) is blocked by a low-priority task. If the low-priority task is starved for CPU time by some mid-priority task(s), then the high-priority task effectively is starved also. It is a special concern in embedded systems with hard real-time requirements.
Priority inversion is a problem that occurs in some systems when a high-priority task (i.e., a thread or a process) is blocked by a low-priority task. For example, if the low-priority task holds a mutual exclusion lock, and the high-priority task needs to acquire the same lock before it can make further progress.
If the low-priority task is starved for CPU time by some mid-priority task(s), then the high-priority task effectively is starved also. It's as if its priority has been "inverted" with respect to the mid-priority task(s).
Priority inversion can be a serious problem in real-time applications where the high-priority task may be responsible for fulfilling critical real-time requirements, and also where the scheduler might not implement any kind of fair scheduling policy.
Fair scheduling is often found in desktop and server platforms where many processes compete with one another for resources. Such systems attempt to give each task a "fair share" of the available CPU time, and a scheduling parameter that is called "priority" may actually be more of a suggestion as to how large a particular task's share should be.
In embedded software with hard real-time requirements, it often is the case that all of the tasks in the system cooperate with one another. Granting "fair shares" to competing tasks often is not a design goal, and the scheduler priorities may be absolute (i.e., a low-priority thread is never allowed to run when a higher-priority thread is waiting to run.)
To make matters worse, hard real-time software often runs on small platforms that may have few CPUs (maybe just one). The possibility of priority inversion between a high-priority real-time task and a low-priority background task on such a constrained, embedded platform can pose a significant risk that the device will malfunction.