Hardware Reference
In-Depth Information
normal execution
critical section
τ 1
a
τ 2
b
τ 3
a
b
b
b
a
p 3
P 1
P 2
P 3
t 1
t 2
t 3
t 4
t 5
t 6
Figure 7.9
Priority inheritance with nested critical sections.
An example of transitive priority inheritance is shown in Figure 7.10. Here, task τ 1
uses a resource R a guarded by a semaphore S a , task τ 3 uses a resource R b guarded
by a semaphore S b , and task τ 2 uses both resources in a nested fashion ( S a protects
the external critical section and S b the internal one). At time t 1 , τ 3 is preempted
within its critical section by τ 2 , which in turn enters its first critical section (the one
guarded by S a ), and at time t 2 it is blocked on semaphore S b . As a consequence,
τ 3 resumes and inherits the priority P 2 . At time t 3 , τ 3 is preempted by τ 1 , which at
time t 4 tries to acquire R a . Since S a is locked by τ 2 , τ 2 inherits P 1 . However, τ 2 is
blocked by τ 3 ; hence, for transitivity, τ 3 inherits the priority P 1 via τ 2 . When τ 3 exits
its critical section, no other tasks are blocked by it; thus it resumes its nominal priority
P 3 . Priority P 1 is now inherited by τ 2 , which still blocks τ 1 until time t 6 .
7.6.2
PROPERTIES OF THE PROTOCOL
In this section, the main properties of the Priority Inheritance Protocol are presented.
These properties are then used to analyze the schedulability of a periodic task set and
compute the maximum blocking time that each task may experience.
 
Search WWH ::




Custom Search