Hardware Reference
In-Depth Information
1.3.5
SEMAPHORES
The typical semaphore mechanism used in traditional operating systems is not suited
for implementing real-time applications because it is subject to the priority inversion
phenomenon, which occurs when a high-priority task is blocked by a low-priority
task for an unbounded interval of time. Priority inversion must absolutely be avoided
in real-time systems, since it introduces nondeterministic delays on the execution of
critical tasks.
For the mutual exclusion problem, priority inversion can be avoided by adopting par-
ticular protocols that must be used every time a task wants to enter a critical section.
For instance, efficient solutions are provided by Basic Priority Inheritance [SRL90],
Priority Ceiling [SRL90], and Stack Resource Policy [Bak91]. These protocols will
be described and analyzed in Chapter 7. The basic idea behind these protocols is to
modify the priority of the tasks based on the current resource usage and control the
resource assignment through a test executed at the entrance of each critical section.
The aim of the test is to bound the maximum blocking time of the tasks that share
critical sections.
The implementation of such protocols may require a substantial modification of the
kernel, which concerns not only the wait and signal calls but also some data structures
and mechanisms for task management.
1.3.6
MEMORY MANAGEMENT
Similarly to other kernel mechanisms, memory management techniques must not in-
troduce nondeterministic delays during the execution of real-time activities. For exam-
ple, demand paging schemes are not suitable to real-time applications subject to rigid
time constraints because of the large and unpredictable delays caused by page faults
and page replacements. Typical solutions adopted in most real-time systems adhere to
a memory segmentation rule with a fixed memory management scheme. Static parti-
tioning is particularly efficient when application programs require similar amounts of
memory.
In general, static allocation schemes for resources and memory management increase
the predictability of the system but reduce its flexibility in dynamic environments.
Therefore, depending on the particular application requirements, the system designer
has to make the most suitable choices for balancing predictability against flexibility.
Search WWH ::




Custom Search