Transcript module_33

Traditional OSes with Soft RealTime Scheduling
Module 3.3
For a good summary, visit:
http://www.cs.uah.edu/~weisskop/osnotes_html/M8.html
1
General Purpose Operating Systems with
Soft Real-Time Capability
• A number of modern operating systems
include features that support soft real time
applications such as multimedia, interactive
graphics, any other kind of process that needs
very quick attention.
• As a result, other applications may suffer
degraded performance and even starvation, but
the benefits usually make such side effects
acceptable. The characteristics of these
systems are similar to those in hard RTS, but
the requirements are less stringent.
2
Characteristics
• Scheduling must be based on priorities, even if
this results in starvation for other processes in
the system.
• Real time processes must not be subject to any
kind of aging.
• Once a real time process has become ready to
run, it must be dispatched as quickly as
possible; i.e., minimize dispatch latency: the
delay between the time a process is ready to
run, and the time that it's actually dispatched.
3
Characteristics
• To achieve quick response, the kernel of the operating system
should be preemptible. In nonpreemptible kernels, such as
traditional UNIX, the operating system is allowed to finish any
operation it begins. This is a way for providing mutual exclusion
to system data structures, but it does not satisfy the rapid
response criteria. Preemptible kernels contribute to determinism
in the form of reduced dispatch latency.
• Systems may put preemption points into kernel routines at places
where system variables are in a consistent state ( i.e., outside of
critical sections). Or, the entire kernel may be made preemptible.
(e.g., SVR4 and Solaris, respectively.)
• Priority inversion presents problems: a high priority process (P1)
can't run because a lower priority process (P2) has locked a
needed resource. At the same time, P2 can't run because P3, a
process with priority lower than P1 but higher than P3 wishes to
run. Thus P2 is blocking P1, even tho P1 has higher priority than
P3.
4
UNIX SVR4 Scheduling
• Highest preference to real-time
processes
• Next-highest to kernel-mode processes
• Lowest preference to other user-mode
processes
5
SVR4 Dispatch Queues
Windows 2000 Scheduling
• Priorities organized into two bands or
classes
– Real-time
– Variable
• Priority-driven preemptive scheduler
7
Linux Scheduling
• Scheduling classes
– SCHED_FIFO: First-in-first-out real-time
threads
– SCHED_RR: Round-robin real-time threads
– SCHED_OTHER: Other, non-real-time
threads
• See handout.
10