Hardware Reference
In-Depth Information
SYSTEM CEILING
The resource access protocol adopted in the SRP also requires a system ceiling , Π s ,
defined as the maximum of the current ceilings of all the resources; that is,
Π s =ma k {
C R k }
.
Notice that Π s is a dynamic parameter that can change every time a resource is ac-
cessed or released by a task.
7.8.2
PROTOCOL DEFINITION
The key idea of the SRP is that when a task needs a resource that is not available, it
is blocked at the time it attempts to preempt rather than later. Moreover, to prevent
multiple priority inversions, a task is not allowed to start until the resources currently
available are sufficient to meet the maximum requirement of every task that could
preempt it. Using the definitions introduced in the previous paragraph, this is achieved
by the following preemption test:
SRP Preemption Test : A task is not permitted to preempt until its priority
is the highest among those of all the tasks ready to run, and its preemption
level is higher than the system ceiling.
If the ready queue is ordered by decreasing priorities, the preemption test can be sim-
ply performed by comparing the preemption level π ( τ ) of the ready task with the high-
est priority (the one at the head of the queue) with the system ceiling. If π ( τ ) > Π s ,
task τ is executed, otherwise it is kept in the ready queue until Π s
becomes less than
π ( τ ). The condition π ( τ ) > Π s
has to be tested every time Π s
may decrease; that is,
every time a resource is released.
OBSERVATIONS
The implications that the use of the SRP has on tasks' execution can be better under-
stood through the following observations:
Passing the preemption test for task τ ensures that the resources that are currently
available are sufficient to satisfy the maximum requirement of task τ and the
maximum requirement of every task that could preempt τ . This means that once
τ starts executing, it will never be blocked for resource contention.
Search WWH ::




Custom Search