Information Technology Reference
In-Depth Information
aperiodic tasks. Because interrupts allow for this flexibility, they are very popular
among real-time operating system designs. An interrupt is a signal to the system
that something needs to be addressed. If a task is in the middle of execution and an
interrupt occurs, depending on the type of scheduling implemented, the task may be
preempted so that the new task can run.
There are a couple types of interrupt-driven systems; they usually are referred to
as foreground, background, or foreground/background systems. With a foreground
system, all tasks are scheduled into periodic tasks that execute at regular intervals:
1 ms, 2 ms, 10 ms, and so on. A background system is one where there are no periodic
tasks and everything runs from the main program. A foreground/background system
is a hybrid between the two. There is a background task, often referred to as the
idle loop. Also, there are periodic tasks that are executed based on their rate. The
background task usually is reserved for gathering statistically information regarding
system utilization, whereas the foreground tasks run the application.
3.4.2
Periodic versus Aperiodic Tasks
Tasks may be scheduled periodically, or they may occur aperiodically. A periodic
task is one that occurs during regular time intervals; for example, a task may execute
every 1 ms or every 2 ms. An aperiodic task is one that happens randomly as a result
of an outside request or an exception. An example of an outside request is a user
typing on a keyboard. The task may be initiated when a user presses down on a
key and the purpose of the task may be to determine which key has been pressed.
An example of an exception is a divide-by-zero error. The system must satisfy the
deadlines of the periodic tasks and service the aperiodic tasks as soon as possible
(Lin & Tarng, 1991). This can be difficult because the frequency of aperiodic tasks
many times are not known during the design of the system. They must be estimated
as closely as possible so that the system utilization is at a safe level, allowing periodic
tasks to complete safely before their deadline. At the same time, there should not be
a noticeable delay for the servicing of aperiodic tasks.
A significant amount of research has been performed on this topic, and new
algorithms have been developed to address the concern of mixing aperiodic tasks
with periodic ones. The Slack Stealing Algorithm , designed by Lehoczky and Thuel
is one such algorithm. The methods in their algorithm “provide a unified framework
for dealing with several related problems, including reclaiming unused periodic and
aperiodic execution time, load shedding, balancing hard and soft aperiodic execution
time and coping with transient overloads”(Lehoczky & Thuel, 1995).
3.4.3
Preemption
Preemption occurs when a task that currently is being executed is evicted by the
scheduler so that another task may run on the CPU. Tasks may be preempted be-
cause another task, one that has a higher priority, is ready to execute its code. In
a multitasking environment, most operating systems allow each task o run for a
predetermined time quantum. This provides the appearance that multiple tasks are
Search WWH ::




Custom Search