Page 131 - DCAP103_Principle of operating system
P. 131
Principles of Operating Systems
Notes no other threads that might contend for the same semaphore can run until the semaphore is
released. It is easy to see how this prevents chained blocking.
Figure 4.9: Priority Ceilings
rS1 rS2 S2
H
M
S2
L
S1
Several RTOSes provide support for both priority inheritance and priority ceilings, leaving
the decision up to the system designer. Ada’s protected objects implement the priority ceiling
protocol.
4.4.11 Changing Requirements
Many of the real-time operating systems in use today were originally designed for software
systems that were smaller, simpler, and ran on processors without memory protection hardware.
With the ever-increasing complexity of applications in today’s embedded systems, fault tolerance
and high availability features have become increasingly important. Especially stringent are the
requirements for safety-critical systems.
Fault tolerance begins with processes and memory protection, but extends to much more,
especially the need to guarantee resource availability in the time and space domains. Kernel
support for features like the priority ceiling protocol give safety-critical system designers the
capabilities needed to maximize efficiency and guarantee schedulability in their systems.
4.5 Semaphores
A semaphore is a protected variable whose value can be accessed and altered only by the
operations P and V and initialization operation called ‘Semaphoiinitislize’. Binary Semaphores
can assume only the value 0 or the value 1 counting semaphores also called general semaphores
can assume only non-negative values. The P (or wait or sleep or down) operation on semaphores
S, written as P(S) or wait (S), operates as follows:
P(S):IF S > 0
THEN S := S – 1
ELSE (wait on S)
The V (or signal or wakeup or up) operation on semaphore S, written as V(S) or signal (S),
operates as follows:
V(S):IF (one or more process are waiting on S)
THEN(let one of these processes proceed)
ELSE S := S +1
124 LOVELY PROFESSIONAL UNIVERSITY