Escolar Documentos
Profissional Documentos
Cultura Documentos
Scheduling
Real-Time Systems (from Dr. Chalermek
Intanagonwiwat)
Result in severe consequences if logical and
timing correctness are not met
Two types exist
Soft real-time
• Tasks are performed as fast as possible
• Late completion of jobs is undesirable but not fatal.
• System performance degrades as more & more
jobs miss deadlines
• Example:
• Online Databases
Real-Time Systems (cont.) (from Dr.
Chalermek Intanagonwiwat)
Hard real-time
• Tasks have to be performed on time
• Failure to meet deadlines is fatal
• Example :
• Flight Control System
Qualitative Definition
Hard and Soft Real Time Systems
(Operational Definition) (from Dr. Chalermek Intanagonwiwat)
Completed C
Deadline D
Clock
External interrupt
Periodic – aperiodic
Fixed – variable computation time
Predictable – unpredictable
Job
Each unit of work that is scheduled and executed by the
system
Task
A set of related jobs
For example, a periodic task Ti consists of jobs J1, J2, J3,
… coming at every period
Release time
Time instant at which a job becomes available for execution
It can be executed at any time at or after the release time
Deadline
Time instant by which a job should be finished
Relative deadline: Maximum allowable response time
Absolute deadline = release time + relative deadline
Periodic task Ti
Period Pi
Worst case execution time Ci
Relative deadline Di
Job Jik
Absolute deadline = release time + relative
deadline
Response time = finish time – release time
Deadline miss if
Finish time > absolute deadline
Response time of Jik > Di
10 Real-time computing 2019-12-17
Real-Time Workload (from Insup Lee)
Relative deadline
Real-Time Task (from Insup Lee)
0 5 10 15
Periodic-Aperiodic Tasks
Priority driven
Scheduling Algorithms in RTOS
(cont.) (from Dr. Chalermek Intanagonwiwat)
Clock Driven
All parameters about jobs (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
(cont.) (from Dr. Chalermek Intanagonwiwat)
Weighted Round Robin
Jobs scheduled in FIFO manner
Time quantum given to jobs is proportional to it’s
weight
Example use : High speed switching network
• QOS guarantee.
Not suitable for precedence constrained jobs.
• Job A can run only after Job B. No point in giving time
quantum to Job B before Job A.
Example task set
Priority Scheduling
Processor never left idle when there
are ready tasks
Processor allocated to processes
according to priorities
Priorities
• Static - at design time
• Dynamic - at runtime
Priority Scheduling
(from Dr. Chalermek Intanagonwiwat)
(4,1)
(5,2)
(7,2)
Real-Time Scheduling (from Insup
Lee)
(5,2)
5 10 15
(7,2)
5 10 15
RM (Rate Monotonic) (from Insup Lee)
T2 (5,2)
5 10 15
T3 (7,2)
5 10 15
RM (Rate Monotonic) (from Insup Lee)
T1 (4,1)
T2 (5,2)
5 10 15
T3 (7,2)
5 10 15
RM (Rate Monotonic) (from Insup Lee)
T1 (4,1)
T2 (5,2)
5 10 15
T3 (7,2)
5 10 15
Response Time (from Insup Lee)
Response time
Duration from released time to finish
time
T1 (4,1)
T2 (5,2)
5 10 15
T3 (10,2)
5 10 15
Response Time (from Insup Lee)
Response time
Duration from released time to finish time
Response Time
T1 (4,1)
T2 (5,2)
5 10 15
T3 (10,2)
5 10 15
Response Time (from Insup Lee)
T1 (4,1)
T2 (5,2)
5 10
T3 (10,2)
5 10
RM - Schedulability Analysis
(from Insup Lee)
0.9
0.8
0.7
0.6
0.5
1 4 16 64 256 1024 4096
T2 (5,2)
5 10 15
T3 (7,2)
5 10 15
EDF (Earliest Deadline First)
(from Insup Lee)
T1 (4,1)
T2 (5,2)
5 10 15
T3 (7,2)
5 10 15
EDF (Earliest Deadline First)
(from Insup Lee)
T1 (4,1)
T2 (5,2)
5 10 15
T3 (7,2)
5 10 15
EDF (Earliest Deadline First)
(from Insup Lee)
T1 (4,1)
T2 (5,2)
5 10 15
T3 (7,2)
5 10 15
EDF (Earliest Deadline First)
(from Insup Lee)
T2 (5,2)
5 10 15
T3 (7,2)
5 10 15
Processor Demand Bound
(from Insup Lee)
T1 (4,1)
T2 (5,2)
5 10 15
T3 (7,2)
5 10 15
EDF - Schedulability
Analysis (from Insup Lee)
Baruah et al.
“Algorithms and complexity concerning the preemptive
scheduling of periodic, real-time tasks on one
processor”, Journal of Real-Time Systems, 1990.
T1 T3 T1 T4
0 3 5 6 7 0 3 5 6 7
Least Slack Time First (LSF)