Chapter 4 – Periodic Task Scheduling In many real-time systems periodic tasks dominate the demand....
-
date post
22-Dec-2015 -
Category
Documents
-
view
222 -
download
2
Transcript of Chapter 4 – Periodic Task Scheduling In many real-time systems periodic tasks dominate the demand....
![Page 1: Chapter 4 – Periodic Task Scheduling In many real-time systems periodic tasks dominate the demand. Three classic periodic task scheduling algorithms: –](https://reader031.fdocuments.in/reader031/viewer/2022032310/56649d805503460f94a63daa/html5/thumbnails/1.jpg)
Chapter 4 – Periodic Task Scheduling
In many real-time systems periodic tasks dominate the demand.
Three classic periodic task scheduling algorithms:
– Time Line (Cyclic)
– Rate Monotonic
– Earliest Deadline First
What is the landscape here?
What causes the challenges?
![Page 2: Chapter 4 – Periodic Task Scheduling In many real-time systems periodic tasks dominate the demand. Three classic periodic task scheduling algorithms: –](https://reader031.fdocuments.in/reader031/viewer/2022032310/56649d805503460f94a63daa/html5/thumbnails/2.jpg)
Periodic Task Scheduling Notation
Ti denotes the period of task i
Ci denotes the Computation time for one instance of task i
![Page 3: Chapter 4 – Periodic Task Scheduling In many real-time systems periodic tasks dominate the demand. Three classic periodic task scheduling algorithms: –](https://reader031.fdocuments.in/reader031/viewer/2022032310/56649d805503460f94a63daa/html5/thumbnails/3.jpg)
Periodic Task Scheduling Assumptions
![Page 4: Chapter 4 – Periodic Task Scheduling In many real-time systems periodic tasks dominate the demand. Three classic periodic task scheduling algorithms: –](https://reader031.fdocuments.in/reader031/viewer/2022032310/56649d805503460f94a63daa/html5/thumbnails/4.jpg)
Additional Periodic Task Parameters
![Page 5: Chapter 4 – Periodic Task Scheduling In many real-time systems periodic tasks dominate the demand. Three classic periodic task scheduling algorithms: –](https://reader031.fdocuments.in/reader031/viewer/2022032310/56649d805503460f94a63daa/html5/thumbnails/5.jpg)
Processor Utilization Factor - U
< 1 if set is scheduable
Let be the upper bound of the processor utilization factor for a set under a given algorithm A. When the set is said to fully utilize the processor.
1
![Page 6: Chapter 4 – Periodic Task Scheduling In many real-time systems periodic tasks dominate the demand. Three classic periodic task scheduling algorithms: –](https://reader031.fdocuments.in/reader031/viewer/2022032310/56649d805503460f94a63daa/html5/thumbnails/6.jpg)
Time Line Scheduling (Cyclic Scheduling)
Time Line Scheduling (Off-line scheduling strategy)– Divide the time line into time slices for scheduling tasks, e.g. use the Greatest Common Divisor of the Task Periods as the time slice:
40 Hz
20 Hz
10 Hz
Schedulability is guaranteed if:
Time line scheduling is sensitive to changes in the task parameters.
Can time line scheduling also accommodate aperiodic tasks ?
![Page 7: Chapter 4 – Periodic Task Scheduling In many real-time systems periodic tasks dominate the demand. Three classic periodic task scheduling algorithms: –](https://reader031.fdocuments.in/reader031/viewer/2022032310/56649d805503460f94a63daa/html5/thumbnails/7.jpg)
Rate Monotonic Scheduling
RM is optimal among all fixed Priority assignment schedules.
Why?
How can you how show that it must be optimal?
Which is clearly non-optimal
![Page 8: Chapter 4 – Periodic Task Scheduling In many real-time systems periodic tasks dominate the demand. Three classic periodic task scheduling algorithms: –](https://reader031.fdocuments.in/reader031/viewer/2022032310/56649d805503460f94a63daa/html5/thumbnails/8.jpg)
Rate Monotonic – Calc of ULUB for Two Tasks
Let , the number of
Then the schedule produced by RM satisfies one of two conditions:
The critical time zone is
for Uub
![Page 9: Chapter 4 – Periodic Task Scheduling In many real-time systems periodic tasks dominate the demand. Three classic periodic task scheduling algorithms: –](https://reader031.fdocuments.in/reader031/viewer/2022032310/56649d805503460f94a63daa/html5/thumbnails/9.jpg)
Earliest Deadline First
Proof: Assume U > 1 and the task set is schedulable. This leads to a contradiction:
![Page 10: Chapter 4 – Periodic Task Scheduling In many real-time systems periodic tasks dominate the demand. Three classic periodic task scheduling algorithms: –](https://reader031.fdocuments.in/reader031/viewer/2022032310/56649d805503460f94a63daa/html5/thumbnails/10.jpg)
Example: Comparing RM to EDF
Since U > ln 2 = 0.69, Schedulability can’t be guaranteed using Rate Monotonic
![Page 11: Chapter 4 – Periodic Task Scheduling In many real-time systems periodic tasks dominate the demand. Three classic periodic task scheduling algorithms: –](https://reader031.fdocuments.in/reader031/viewer/2022032310/56649d805503460f94a63daa/html5/thumbnails/11.jpg)
Homework #4 Lecture 5/1
1) Verify the schedulability under RM of the following task set:
Ci Ti
1 4
2 6
3 8
2) Verify the schedulability under EDF, and then construct the corresponding schedule.
Due May 8
![Page 12: Chapter 4 – Periodic Task Scheduling In many real-time systems periodic tasks dominate the demand. Three classic periodic task scheduling algorithms: –](https://reader031.fdocuments.in/reader031/viewer/2022032310/56649d805503460f94a63daa/html5/thumbnails/12.jpg)
Mutual Exclusion Problems
![Page 13: Chapter 4 – Periodic Task Scheduling In many real-time systems periodic tasks dominate the demand. Three classic periodic task scheduling algorithms: –](https://reader031.fdocuments.in/reader031/viewer/2022032310/56649d805503460f94a63daa/html5/thumbnails/13.jpg)
Mutual Exclusion Problems
![Page 14: Chapter 4 – Periodic Task Scheduling In many real-time systems periodic tasks dominate the demand. Three classic periodic task scheduling algorithms: –](https://reader031.fdocuments.in/reader031/viewer/2022032310/56649d805503460f94a63daa/html5/thumbnails/14.jpg)
Mutual Exclusion Problems
![Page 15: Chapter 4 – Periodic Task Scheduling In many real-time systems periodic tasks dominate the demand. Three classic periodic task scheduling algorithms: –](https://reader031.fdocuments.in/reader031/viewer/2022032310/56649d805503460f94a63daa/html5/thumbnails/15.jpg)
Mutual Exclusion Problems
![Page 16: Chapter 4 – Periodic Task Scheduling In many real-time systems periodic tasks dominate the demand. Three classic periodic task scheduling algorithms: –](https://reader031.fdocuments.in/reader031/viewer/2022032310/56649d805503460f94a63daa/html5/thumbnails/16.jpg)
Mutual Exclusion Problems
• Priority Ceiling protocol:
– The priority ceiling PC(S) is the highest priority of all processes that may lock S.
– A task P that attempts to lock a semaphore will be suspended unless its priority is higher than PC(S) for all S currently locked by all tasks Q not= P.
– If P is suspended, then the task Q that holds the lock with the highest PC is considered to be blocking P. Q then inherits P’s priority.
![Page 17: Chapter 4 – Periodic Task Scheduling In many real-time systems periodic tasks dominate the demand. Three classic periodic task scheduling algorithms: –](https://reader031.fdocuments.in/reader031/viewer/2022032310/56649d805503460f94a63daa/html5/thumbnails/17.jpg)
Mutual Exclusion Problems
![Page 18: Chapter 4 – Periodic Task Scheduling In many real-time systems periodic tasks dominate the demand. Three classic periodic task scheduling algorithms: –](https://reader031.fdocuments.in/reader031/viewer/2022032310/56649d805503460f94a63daa/html5/thumbnails/18.jpg)
Mutual Exclusion ProblemsAgain, using Priority Ceiling