Lecture 5
Lecture 5
Multiprocessor
and Real-Time
Scheduling
Agenda
Multiprocessor Scheduling
Real-Time Scheduling
Linux Scheduling
Real-Time Scheduling
Background
Characteristics of Real-Time Operating Systems
Real-Time Scheduling
Deadline Scheduling
Rate Monotonic Scheduling
Priority Inversion
3
Loosely coupled or distributed multiprocessor, or cluster
• consists of a collection of relatively autonomous systems, each
processor having its own main memory and I/O channels
Functionally specialized processors
• there is a master, general-purpose processor; specialized processors
are controlled by the master processor and provide services to it
Tightly coupled multiprocessor
• consists of a set of processors that share a common main memory
and are under the integrated control of an operating system
Our concern in this section is with the last category, and specifically with
issues relating to scheduling.
Synchronization Granularity
and Processes
No explicit synchronization
among processes
each user is performing a
each represents a particular application
separate, independent
application or job
multiprocessor provides the
same service as a
Typical use is in a time-sharing multiprogrammed
system uniprocessor
actual assignment of
dispatching use of processes to
of a process multiprogramming on processors
individual processors
Assuming all processors are equal, it is
simplest to treat processors as a pooled static or dynamic needs to be
resource and assign processes to processors determined
on demand
Often it is best to have one process per processor; particularly in the case of
multithreaded programs where it is advantageous to have all threads of a
single process executing at the same time.
Thread execution is separated from the rest of the definition of a process
Advantages:
If all threads are treated as a common pool of threads, it is unlikely that all
of the threads of a program will gain access to processors at the same time
the process switches involved may seriously compromise performance
Simultaneous scheduling of the threads that make up a single process
Benefits:
Real-Time Scheduling
Background
Characteristics of Real-Time Operating Systems
Real-Time Scheduling
Deadline Scheduling
Rate Monotonic Scheduling
Priority Inversion
27
The operating system, and in particular the
scheduler, is perhaps the most important
component
• control of laboratory experiments
• process control in industrial plants
• robotics
Examples: • air traffic control
• telecommunications
• military command and control
systems
Correctnessof the system depends not only
on the logical result of the computation but
also on the time at which the results are
produced.
Tasks or processes attempt to control or
react to events that take place in the outside
world.
Theseevents occur in “real time” and tasks
must be able to keep up with them.
Hard real-time task Soft real-time task
Has an associated
one that must meet deadline that is
its deadline. desirable but not
otherwise it will mandatory
cause unacceptable It still makes sense to
damage or a fatal schedule and
error to the system. complete the task
even if it has passed
its deadline.
Periodic tasks
requirement may be stated as:
once per period T
exactly T units apart
Aperiodic tasks
has a deadline by which it must finish or start
may have a constraint on both start and finish
time
Real-time operating systems have
requirements in five general areas:
Determinism
Responsiveness
User control
Reliability
Fail-soft operation
Concerned with how long an operating
system delays before acknowledging an
interrupt.
Operations are performed at fixed,
predetermined times or within
predetermined time intervals
The extent to which an operating
system can deterministically
satisfy requests depends on: