RTOS Session3
RTOS Session3
Purushotham BV
[email protected]
1
Agenda
4.1 Clock-driven Approach
4.2 Weighted Round – Robin Approach
4.3 Priority Driven Approach
4.4 Dynamic v/s Static Systems
4.5 Effective Release Times and Deadlines
4.6 Optimality of The EDF and LST Algorithms
4.7 Non-optimality of The EDF and The LST Algorithms
4.8 Challenges in Validating Timing Constraints in Priority –
Driven Systems
4.8.1 Anomalous Behavior Of Priority-driven Systems
4.8.2 Predictability of Executions
4.8.3 Validation Algorithms and Their Performance
4.9 Off-line Versus On-line Scheduling
4.10 Summary 2
4.1 Clock-driven Approach
• As the name implies, when scheduling is clock-driven (also
called time-driven), decisions on what jobs execute at what
times are made at specific time instants.
• These instants are chosen a priori before the system begins
execution.
• Typically, in a system that uses clock-driven scheduling, all
the parameters of hard real-time jobs are fixed and known.
• A schedule of the jobs is computed off-line and is stored for
use at run time.
• The scheduler schedules the jobs according to this schedule at
each scheduling decision time.
• In this way, scheduling overhead during run-time can be
minimized. 3
Weighted Round – Robin Approach (Contd.,)
• J1,1 and J2,1 execute on processor P1, and J1,2 and J2,2 execute
on processor P2. Suppose that J1,1 is the predecessor of J1,2, and
J2,1 is the predecessor of J2,2.
• Figure 4–1(a) shows that both sets of jobs (i.e., the second jobs
J1,2 and J2,2 in the sets) complete approximately at time 4 if the
jobs are scheduled in a weighted round-robin manner.
• We get this completion time when the length of the time slice is
small compared with 1 and the jobs have the same weight. 9
Weighted Round – Robin Approach (Contd.,)
10
Weighted Round – Robin Approach (Contd.,)
19
Priority – Driven Approach (Contd.,)
• At time 1, J2 completes and, hence, J3 becomes ready. J3 is
placed in the priority queue ahead of J7 and is scheduled on
P2, the processor freed by J2.
• At time 3, both J1 and J3 complete. J5 is still not released.
J4 and J7 are scheduled.
• At time 4, J5 is released. Now there are three ready jobs. J7
has the lowest priority among them. Consequently, it is
preempted. J4 and J5 have the processors.
• At time 5, J4 completes. J7 resumes on processor P1.
• At time 6, J5 completes. Because J7 is not yet completed,
both J6 and J8 are not ready for execution. Consequently,
processor P2 becomes idle.
• J7 finally completes at time 8.
20
• J6 and J8 can now be scheduled and they are.
Priority – Driven Approach (Contd.,)
21
4.4 Dynamic Versus Static Systems
24
4.5 Effective Release Times And Deadlines
• The given release time of J3 is 1, but the latest effective release time
of its predecessors is 2, that of J1 .
• Hence, the effective release time of J3 is 2. One can repeat this
procedure and find that the effective release times of the rest of the
jobs are 4, 2, 4, and 6, respectively.
• Similarly, J6 and J7 have no successors, and their effective
deadlines are equal to their given deadlines, 20 and 21, respectively.
• Since the effective deadlines of the successors of J4 and J5 are larger
than the given deadlines of J4 and J5 , the effective deadlines of J4
and J5 are equal to their given deadlines.
• On the other hand, the given deadline of J3 is equal to 12, which is
larger than the minimum value of 8 among the effective deadlines of
its successors.
• Hence, the effective deadline of J3 is 8. In a similar way, we find that
the effective deadlines of J1 and J2 are 8 and 7, respectively. 28
4.6 Optimality Of The EDF and LST Algorithms
30
Proof of Optimality for EDF
31
Proof of Optimality for EDF (Contd.,)
32
Proof of Optimality for EDF (Contd.,)
33
Latest Release Time (LRT)
34
Least Slack Time First (LST)
35
Comparison of EDF, LRT, LST
36
4.7 Non-optimality of the EDF and the
LST Algorithms
37
Non-optimality of the EDF and the LST
Algorithms (Contd.,)
38
4.8 Challenges in Validating Timing
Constraints in Priority-driven Systems
• It is difficult to validate that the deadlines of all jobs
scheduled in a priority- driven manner indeed meet
their deadlines when the job parameters vary.
40
Anomalous Behavior of PDS (Contd.,)
41
Anomalous Behavior of PDS (Contd.,)
42
Anomalous Behavior of PDS (Contd.,)
43
4.8.2 Predictability of Executions
44
Proof for Non-Existence
45
Proof for Non-Existence (Contd.,)
46
4.8.3 Validation Algorithms and
Their Performance
• Properties:
Correctness: correct, if no false positives
Execution time: some run in constant time
Robustness: violating some assumptions still retains
correctness
Accuracy: accurate, if no false negatives
47
4.9 Off-line Versus On-line Scheduling
48
No Optimal Online Scheduling
49
Overload
50
EDF /LST and Overload
51
Theoretic Limit on Competitive Factor
52
Theoretic Limit on Competitive Factor (Contd.,)
53
Theoretic Limit on c (Example)
54
4.10 Summary
56
Summary (Contd.,)
57