Page 141 - DCAP608_REAL TIME SYSTEMS
P. 141
Real Time Systems
Notes 14.2 Practical Factors
We have assumed that:
Jobs are preemptible at any time
Jobs never suspend themselves
Each job has distinct priority
The scheduler is event driven and acts immediately
These assumptions are often not valid and how does this affect the system
14.2.1 Blocking and Priority Inversion
A ready job is blocked when it is prevented from executing by a lower-priority job; a priority
inversion is when a lower-priority job executes while a higher-priority job is blocked.
These occur because some jobs cannot be pre-empted:
Many reasons why a job may have non-preemptible sections
Critical section over a resource
Some system calls are non-preemptible
Disk scheduling
If a job becomes non-preemptible, priority inversions may occur, these may cause a higher
priority task to miss its deadline
When attempting to determine if a task meets all of its deadlines, must consider not only
all the tasks that have higher priorities, but also non-preemptible regions of lower-priority
tasks.
Add the blocking time when calculating if a task is schedulable
14.2.2 Self-Suspension and Context Switches
Self-Suspension
A job may invoke an external operation (e.g. request an I/O operation), during which
time it is suspended.
This means the task is no longer strictly periodic and again need to take into account self-
suspension time when calculating a schedule.
Context Switches
Assume maximum number of context switches K for a job in T is known; each takes t
i i CS
time units.
Compensate by setting execution time of each job, e = e + 2t (more if jobs self-
actual CS
suspend, since additional context switches).
136 LOVELY PROFESSIONAL UNIVERSITY