0% found this document useful (0 votes)
164 views18 pages

Scheduling Basics PDF

Real-time tasks are generated by internal or external events and have deadlines that must be met. Real-time task scheduling refers to the order tasks are executed to meet their deadlines. It is an important job of the real-time operating system. Tasks can be periodic, sporadic, or aperiodic. A scheduler must produce a valid schedule where at most one task runs at a time without overlapping deadlines. Effective schedulers have been developed for uniprocessor and multiprocessor systems.

Uploaded by

Prathamesh Gujar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
164 views18 pages

Scheduling Basics PDF

Real-time tasks are generated by internal or external events and have deadlines that must be met. Real-time task scheduling refers to the order tasks are executed to meet their deadlines. It is an important job of the real-time operating system. Tasks can be periodic, sporadic, or aperiodic. A scheduler must produce a valid schedule where at most one task runs at a time without overlapping deadlines. Effective schedulers have been developed for uniprocessor and multiprocessor systems.

Uploaded by

Prathamesh Gujar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

Basics of Real-Time Task

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

• The track correction task starts


2000 mSecs after the launch of
the rocket:
 Periodically recurs every 50 milli
Seconds then on.
 Each instance of the task requires
a processing time of 8 mSecs and
its relative deadline is 50 mSecs.
07-Sep-19 11
Important Scheduling
Terminologies
– Valid Schedule:
• At most one task is assigned to a
processor at a time.
• No task is scheduled before it is ready.
• Precedence and resource constraints of
all tasks are satisfied.
– Feasible Schedule:
• Valid schedule is one in which all tasks
meet
07-Sep-19
their respective time constraints. 12
Important Scheduling
Terminologies
– Proficient Scheduler:
• A scheduler S1 is as proficient as another
Scheduler S2:
• If whichever tasks that S2 can feasibly
schedule so can S1, but not vice versa.
• Equally proficient schedulers:
• If a task set scheduled by one can also be
scheduled by the other and vice versa.
07-Sep-19 13
Important Scheduling
Terminologies
Optimal Scheduler:
•An optimal scheduler can
feasibly schedule any task set
that can be scheduled by any
other scheduler.

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

• Time-Driven • Single frequency,


Cyclic Executive Polled
• Multi-rate Cyclic • Multiple
Executive frequencies, Polled
• Priority-based
• Polled + Interrupt
Preemptive Scheduler
driven
•07-Sep-19 18

You might also like