Hardware Reference
In-Depth Information
7.2
Using the Priority Inheritance Protocol, a task τ i can be blocked at most for
one critical section by each lower priority task. Moreover, a critical section
can block τ i only if it belongs to a task with lower priority and it is shared
with τ i (direct blocking) or with higher priority tasks (push-through blocking).
Finally, we have to consider that two critical sections cannot block a task if they
are protected by the same semaphore or they belong to the same task. Hence,
if Z i,k
denotes the longest critical section of τ i
guarded by semaphore S k ,we
have the following:
Task τ 1 can only experience direct blocking (since there are no tasks with
higher priority), and the set of critical sections that can potentially block
it is
. It can be blocked at most for the duration of two
critical sections in this set. Thus, the maximum blocking time is given
by the sum of the two longest critical sections in this set. In this case,
however, note that the longest critical sections are Z 3 A and Z 3 C , which
belong to the same task; hence they cannot be selected together. Hence,
the maximum blocking time for τ 1
{
Z 2 A , Z 3 A , Z 3 C }
is B 1
=( δ 2 A
1) + ( δ 3 C
1) =
2+5=7.
Task τ 2 can experience direct blocking on Z 3 A and Z 3 B and push-through
blocking on Z 3 A
and Z 3 C .
Hence, the set of critical sections that can
potentially block τ 2 is
. It can be blocked at most for the
duration of one critical section in this set. Thus, the maximum blocking
time is given by the longest critical section in this set, that is Z 3 C . Hence,
we have B 2 = δ 3 C
{
Z 3 A , Z 3 B , Z 3 C }
1=5.
Task τ 3 cannot be blocked, because it is the task with the lowest priority (it
can only be preempted by higher priority tasks). Hence, we have B 3 =0.
7.3
Using the Priority Ceiling Protocol, a task τ i can be blocked at most for one
critical section during its execution. The set of critical sections that can poten-
tially block τ i is the same as that computed for the Priority Inheritance Protocol.
Hence, if Z i,k
denotes the longest critical section of τ i
guarded by semaphore
S k , we have the following:
The set of critical sections that can block τ 1 is
{
Z 2 A , Z 3 A , Z 3 C }
. Hence,
the maximum blocking time for τ 1 is B 1 = δ 3 C
1=5.
The set of critical sections that can block τ 2 is
{
Z 3 A , Z 3 B , Z 3 C }
. Hence,
the maximum blocking time for τ 2 is B 2 = δ 3 C
1=5.
Task τ 3 cannot be blocked, because it is the task with the lowest priority
(it can only be preempted by higher priority tasks). Hence, B 3 =0.
Search WWH ::




Custom Search