Professional Documents
Culture Documents
Rtos
Rtos
Agenda
Hard and soft RTOS
Scheduling
Priority inversion
Deadlock and starvation
Task synchronization
Hard and Soft Real Time Systems
Hard Real Time System
Failure to meet deadlines is fatal
example : Flight Control System
Soft Real Time System
Late completion of jobs is undesirable but not
fatal.
System performance degrades as more & more
jobs miss deadlines
Online Databases
Task Management
Priority Scheduling
(Greedy / List / Event Driven)
Context switch
Scheduling Algorithms in RTOS (contd)
Clock Driven
All parameters about jobs (release time/
execution time/deadline) known in
advance.
Schedule can be computed offline or at
some regular time instances.
Minimal runtime overhead.
Not suitable for many applications.
Scheduling Algorithms in RTOS (contd)
Time
Only a higher priority SCHED_FIFO or SCHED_RR task can preempt a
SCHED_FIFO task – all others will be starved as it runs
13
Round Robin Scheduling
Round-robin scheduling
Same as SCHED_FIFO but with timeslices
Time
Only a higher priority SCHED_FIFO or SCHED_RR task can
preempt a SCHED_FIFO
Tasks of equal priority preempt each other after timeslice
expiration
14
Scheduling Algorithms in RTOS (contd)
Priority Scheduling
(Greedy/List/Event Driven)
Processor never left idle when there are
ready tasks
Processor allocated to processes according
to priorities
Priorities
static - at design time
Dynamic - at runtime
Preemptive Fixed Priority
Scheduling
High & low priority jobs
arrived together
High Priority Task
Time
Low Priority Task
16
Preemptive Fixed Priority
Scheduling
High priority job is
executed first
High Priority Task
Time
Low Priority Task
Time
Low Priority Task
17
Preemptive Fixed Priority
Scheduling
Time
Low Priority Task
18
Preemptive Fixed Priority
Scheduling
Preempts low priority
High Priority Task job
Time
Low Priority Task
Time
Low Priority Task
19
Priority Scheduling