 |
Real Time Scheduling Algorithms →
Resource Access Protocol with Priority Inheritance
|
One way of dealing with priority inversion is to use the priority inheritance protocol.
This protocol works as follows:
-
Tasks are scheduled according to their active priorities. Tasks with the same priorities are
scheduled on a first-come, first-served basis.
-
When a task T1 executes P(S) and exclusive access is already granted to some other task T2, then T1
will become blocked. If the priority of T2 is lower than that of T1, T2 inherits the priority of T1.
Hence, T2 resumes execution. In general, tasks inherit the highest priority of tasks blocked by it.
-
When a task T2 executes V(S), its priority is decreased to the lowest priority of the tasks blocked by it.
If no other task is blocked by T2, its priority is reset to the original value. Furthermore, the
highest priority task so far blocked on S is resumed.
-
Priority inheritance is transitive: if T1 blocks T0 and T2 blocks T1, then T2 inherits the priority
of T0.
Introduction > Real Time Scheduling Algorithms
> Resource Access Protocol with Priority Inheritance