Scheduling Basics PDF
Scheduling Basics PDF
Scheduling
07-Sep-19 1
Introduction
• Real-time tasks get generated due
to certain event occurrences:
Either internal or external events.
• Example:
A task may get generated due to a
temperature sensor sensing high-
level.
• When a task gets generated:
It is said to be released or arrived .
07-Sep-19 2
Real-Time Task Scheduling
Essentially refers to the order in
which the various tasks are to be
executed.
Primary means adopted by an
operating system to meet task
deadlines.
Obviously, scheduler is a very
important component of RTOS.
07-Sep-19 3
Real-Time Workload
• Job:
A unit of work
A computation, a file read, a message
transmission, etc
A task instance
• Task: a sequence of similar jobs Absolute
Released deadline
Execution time
Relative deadline
07-Sep-19 4
Task Instance (Job)
• A task typically recurs a large
number of times:
Each time triggerred by an event
Each time a task recurs, an
instance of the task is said to have
been generated.
• The ith time a task T recurs:
Task instance Ti is said to have
arrived.
07-Sep-19 5
Relative and Absolute
Deadlines
• Absolute deadline:
Counted from time 0.
• Relative deadline:
Counted from time of occurrence of
task.
deadline
abs
relative
0 d
07-Sep-19
te 6
Response Time
• From Release time
• The time of occurrence of the event
generating the task.
• To completion time
• Results produced by the task
Response time
007-Sep-19 e t 7
Response Time
• For soft real-time tasks:
The response time needs to be
minimized.
• For hard real-time tasks:
As long as the task completes
within its deadline,
• No advantage of completing it any
early.
07-Sep-19 8
Types of Real-Time Tasks
Periodic:
• Periodic tasks repeats after a certain
fixed time interval.
• A vast majority of real-time tasks are
periodic.
Sporadic:
• Sporadic tasks recurs at random instants.
Aperiodic:
• Same as sporadic except that minimum
separation between two instances can be 90.
07-Sep-19
Phase of a Periodic
Task
• Phase for a periodic task:
The time from 0 till the occurrence of
the first instance of the task.
Denoted by Φ.
Φ P P
0 e1 e2 e3 time
07-Sep-19 10
Phase Example 0
Φ
e1
P
e2
P
e3
time
07-Sep-19 14
Scheduling Points
• At these points on time line:
Scheduler makes decision regarding
which task to be run next.
• Clock-driven:
Scheduling points are defined by
interrupts from a periodic timer.
• Event-driven:
Scheduling points defined by task
completion and generation events.
07-Sep-19 15
Real-Time Task
Scheduling cont…
• Significant amount of research
has been carried out to develop
schedulers for real-time tasks:
Schedulers for uniprocessors
Schedulers for multiprocessors
and distributed systems.
07-Sep-19 16
Task Scheduling on
Uniprocessors
• Focus of much research
during the 1970s and 80s.
• Real-time task schedulers can
be broadly classified into:
Clock-driven
Event-driven
07-Sep-19 17
Summary of Schedulers
• Endless Loop • No Tasks, Polled