EE8691 - Embedded Systems
Unit IV
Priority Inheritance and Priority Ceiling
Lecture 3
[Link], AP(Sr. Gr) / EEE
Objective
Mechanisms adopted to handle Priority Inversion
problem
Embedded Systems [Link], AP(Sr. Gr) / EEE
Priority Inversion
It is the condition in which high priority task need to wait
for a low priority task to release a resource which is shared
between the high priority task and the low priority task,
and a medium priority task which doesn’t require the
shared resource continue its execution by preempting the
low priority task
Embedded Systems [Link], AP(Sr. Gr) / EEE
Priority inversion problem example
S, No Process Priority Arrival Time Execution Time
1 A High 6 4
2 B Medium 2 4
3 C Low 0 6
Consider process A and C share a common resource which is synchronized through
mutual exclusion and B doesn’t require any resource for its execution and C locks the
resource first.
Embedded Systems [Link], AP(Sr. Gr) / EEE
Priority Inversion
Embedded Systems [Link], AP(Sr. Gr) / EEE
Methods to avoid Priority Inversion
Priority Inheritance
Priority ceiling
Embedded Systems [Link], AP(Sr. Gr) / EEE
Priority Inheritance
A low-priority task that is currently accessing a shared resource
requested by a high-priority task temporarily ‘inherits’ the priority
of that high-priority task, from the moment the high-priority task
raises the request.
This eliminates the preemption of low priority task by medium
priority tasks.
Reduces the delay in waiting to get the resource requested by high-
priority task
Embedded Systems [Link], AP(Sr. Gr) / EEE
Priority Inheritance
Embedded System [Link], AP(Sr. Gr) / EEE
Priority Inheritance
Embedded Systems [Link], AP(Sr. Gr) / EEE
Priority Inheritance
Embedded Systems [Link], AP(Sr. Gr) / EEE
Priority Inheritance
Embedded Systems [Link], AP(Sr. Gr) / EEE
Priority Inheritance
Embedded Systems [Link], AP(Sr. Gr) / EEE
Priority Inheritance
Advantage
Reduces the delay in waiting to get the shared resource requested by high-priority task
Disadvantage
Overhead of checking the priorities all tasks which tries to access the shared resource
Dynamic adjustment of priorities
Embedded Systems [Link], AP(Sr. Gr) / EEE
Priority ceiling
In Priority ceiling the priority is associated with each shared resource
The priority associated to each resource is the priority of the highest priority task which
uses this shared resource. This is called Priority ceiling
Priority of task is elevated to the priority of resource
Embedded Systems [Link], AP(Sr. Gr) / EEE
Priority Ceiling
Embedded Systems [Link], AP(Sr. Gr) / EEE
Embedded Systems [Link], AP(Sr. Gr) / EEE
Priority Ceiling
Embedded Systems [Link], AP(Sr. Gr) / EEE
Priority Ceiling
Embedded Systems [Link], AP(Sr. Gr) / EEE
Summary
Priority Inheritance
Priority ceiling
Example problem
Embedded System [Link], AP(Sr. Gr) / EEE
Questions
Explain priority inheritance and priority ceiling with example.
What are the advantages and drawbacks of priority inheritance?
What are the advantages and drawbacks of priority ceiling?
Embedded System [Link], AP(Sr. Gr) / EEE