Best Effort Scheduling Algorithms
-
Upload
phyllis-nunez -
Category
Documents
-
view
40 -
download
1
description
Transcript of Best Effort Scheduling Algorithms
![Page 1: Best Effort Scheduling Algorithms](https://reader035.fdocuments.net/reader035/viewer/2022062304/56813460550346895d9b44db/html5/thumbnails/1.jpg)
Scheduling
Basic Concepts
Ref: Hard Real-Time Computing SystemsGiorgio Buttazzo
Ref: Real-Time Systems & Software Alan Shaw
Processes - Tasks - Threads
![Page 2: Best Effort Scheduling Algorithms](https://reader035.fdocuments.net/reader035/viewer/2022062304/56813460550346895d9b44db/html5/thumbnails/2.jpg)
Real-Time Systems
Periodic and Aperiodic
Hard & Soft Deadlines
Scheduling of Tasks – Static & Dynamic
Sharing of Resources and Critical Sections
Domino Effect
![Page 3: Best Effort Scheduling Algorithms](https://reader035.fdocuments.net/reader035/viewer/2022062304/56813460550346895d9b44db/html5/thumbnails/3.jpg)
Best Effort Scheduling Algorithms
![Page 4: Best Effort Scheduling Algorithms](https://reader035.fdocuments.net/reader035/viewer/2022062304/56813460550346895d9b44db/html5/thumbnails/4.jpg)
Example Cost FunctionsWhat is a “good” system?
![Page 5: Best Effort Scheduling Algorithms](https://reader035.fdocuments.net/reader035/viewer/2022062304/56813460550346895d9b44db/html5/thumbnails/5.jpg)
Metrics for Performance EvaluationWhat is a “good” system?
![Page 6: Best Effort Scheduling Algorithms](https://reader035.fdocuments.net/reader035/viewer/2022062304/56813460550346895d9b44db/html5/thumbnails/6.jpg)
Attempting to Minimize Lateness
![Page 7: Best Effort Scheduling Algorithms](https://reader035.fdocuments.net/reader035/viewer/2022062304/56813460550346895d9b44db/html5/thumbnails/7.jpg)
Scheduling Anomalies
![Page 8: Best Effort Scheduling Algorithms](https://reader035.fdocuments.net/reader035/viewer/2022062304/56813460550346895d9b44db/html5/thumbnails/8.jpg)
Precedence Example
![Page 9: Best Effort Scheduling Algorithms](https://reader035.fdocuments.net/reader035/viewer/2022062304/56813460550346895d9b44db/html5/thumbnails/9.jpg)
Adding a processor
![Page 10: Best Effort Scheduling Algorithms](https://reader035.fdocuments.net/reader035/viewer/2022062304/56813460550346895d9b44db/html5/thumbnails/10.jpg)
Reducing Computation Times ?
![Page 11: Best Effort Scheduling Algorithms](https://reader035.fdocuments.net/reader035/viewer/2022062304/56813460550346895d9b44db/html5/thumbnails/11.jpg)
Weaken Constraints
![Page 12: Best Effort Scheduling Algorithms](https://reader035.fdocuments.net/reader035/viewer/2022062304/56813460550346895d9b44db/html5/thumbnails/12.jpg)
Resource Constraints
![Page 13: Best Effort Scheduling Algorithms](https://reader035.fdocuments.net/reader035/viewer/2022062304/56813460550346895d9b44db/html5/thumbnails/13.jpg)
Successive events are separated by at least p
The Sporadic process
Shaw’s notation:
![Page 14: Best Effort Scheduling Algorithms](https://reader035.fdocuments.net/reader035/viewer/2022062304/56813460550346895d9b44db/html5/thumbnails/14.jpg)
Cyclic Executives for Scheduling Periodic Tasks:
Broken into blocks:
Major Cycles (MCT) – shortest period where all task periods align
all tasks execute in a major cycle
Minor Cycles (mct) – “frames” used to allocate tasks or portions of tasks
Example: Say you have two tasks:
T1 = (c1, p1, d1) = (1, 2, 2)
T2 = (c2, p2, d2) = (1, 3, 3)
|xxxxxx______|xxxxxx______|xxxxxx______|……..
|______xxxxxx______|xxxxxx____________|……
0 1 2 3 4 5 6
MCT = 6
mct = 2 (or 1)
Allocations are: {T1,T2} {T1,T2} {T1}, repeat
![Page 15: Best Effort Scheduling Algorithms](https://reader035.fdocuments.net/reader035/viewer/2022062304/56813460550346895d9b44db/html5/thumbnails/15.jpg)
Can this be scheduled?
What is MCT?
What is mct?
What is a schedule?
![Page 16: Best Effort Scheduling Algorithms](https://reader035.fdocuments.net/reader035/viewer/2022062304/56813460550346895d9b44db/html5/thumbnails/16.jpg)
![Page 17: Best Effort Scheduling Algorithms](https://reader035.fdocuments.net/reader035/viewer/2022062304/56813460550346895d9b44db/html5/thumbnails/17.jpg)
Ada-like implementation of this scheduling.
Clock returns the current time
Delay_until x causes the task to block until at least time x
![Page 18: Best Effort Scheduling Algorithms](https://reader035.fdocuments.net/reader035/viewer/2022062304/56813460550346895d9b44db/html5/thumbnails/18.jpg)
Some principles about periodic scheduling:
We assume all processes are released at time t0. Why?
The MCT is the least common multiple (lcm) of the periods. Why?
The mct must divide the MCT. Why?
The mct must be >= the longest computation block. Why?
mct <= di for all I = 1,…, n
mct + (mct - gcd(mct, pi)) <= di
![Page 19: Best Effort Scheduling Algorithms](https://reader035.fdocuments.net/reader035/viewer/2022062304/56813460550346895d9b44db/html5/thumbnails/19.jpg)
Home work #1: (Lecture 4/03)
From Buttazzo:
From Shaw:
Exercises 2.2: 1, 2, 3, 5, 6