What can be the types of priority inversions that a task might undergo on account of a lower priority task under PCP?
Tasks sharing a set of resources using PCP may undergo three important types of priority inversions: direct inversion, inheritance related inversion, and avoidance inversion. Direct inversion occurs when a higher priority task waits for a lower priority task to release a resource that it needs.
Inheritance related inversion occurs when a lower priority task is holding a resource and a higher priority task is waiting for it. Then, the priority of the lower priority task is raise to that of the waiting higher priority task by the inheritance clause of the PCP.
As a result, the intermediate priority tasks not needing the resource undergo inheritance related inversion. In PCP, when a task requests a resource its priority is checked against CSC. The requesting task is granted use of the resource only when its priority is greater than CSC.
Therefore, even when a resource that a task is requesting is idle, the requesting task may be denied access to the resource if the requesting task priority is less than CSC.
A task, whose priority is greater than the currently executing task, but lesser than the CSC and needs a resource that is currently not in use, is said to undergo avoidance related inversion.