Priority inversion

I have problems understanding Priority Inversion

Fragment from the article:

We believe that there is a task L, with a low priority. Resource R is required for this task. Consider L working, and this acquires resource R. Now there is another task H, with high priority. This task also requires resource R. Consider H begins after L has acquired resource R. Now H must wait until L refuses resource R.

Everything works as expected up to this point, but problems arise when a new task M starts with medium priority during this time. `Since R is still in use (over L), H cannot work. Since M is the unlocked highest priority of the task, it will be scheduled before L. Since L has been superseded by M, L cannot refuse R. So M will work until it is finished, then L will work - at least to such an extent , abandon R - and then run H. Thus, in the above scenario, the task with medium priority was performed before the task with high priority, which is the priority inversion.

The question relates to the second part of the article. Why can't a process with priority H (Highest) preempt a process with priority L (lower), but can a process with priority M (middle) be previously missed? those. if H was blocked since R was used, why is M not locked too?

+5
source share
1 answer

Since M does not require the resource R, it can work while L is still in use; H, on the other hand, cannot work until L can free R.

+4
source

All Articles