t = current_time();
if (C1) then A1;
...
sleep(t + target - current_time());
example
|
T | C | U |
---|---|---|---|
1 | 10 | 2 | 0.2 |
2 | 5 | 2 | 0.4 |
3 | 3 | 1 | 1/3 |
question: is set of tasks & priorities feasible?
simulate execution up to first deadline of lowest priority task
|
T | C | U | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Priority | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | 10 | 2 | 0.2 | 1 | 1 | ||||||||||
2 | 5 | 2 | 0.4 | 2 | 2 | 2 | 2 | ||||||||
3 | 3 | 1 | 1/3 | 3 | 3 | 3 | 3 | ||||||||
3 | 2 | 2 | 3 | 1 | 2 | 3 | 2 | 1 | 3 | 3 > 2 > 1 | |||||
2 | 2 | 3 | 3 | 1 | 2 | 2 | 3 | 1 | 3 | 2 > 3 > 1 | |||||
1 | 1 | 2 | X | 1 > 2 > 3 |
how to assign priorities?
rate-monotonic (RM) scheduling
harmonic task set: each tasks period's is exact multiple of next most frequent task
→ 100% utilization possible with RM scheduling
dynamic priorities: earliest deadline first (EDF) scheduling → 100% utilization possible
|
T | C | U | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Schedule | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | 8 | 1 | 0.125 | 1 | 1 | |||||||||
2 | 5 | 3 | 0.6 | 2 | 2 | 2 | 2 | 2 | 2 | |||||
3 | 4 | 1 | 0.25 | 3 | 3 | 3 | ||||||||
3 | 2 | 2 | 2 | 3 | 2 | 2 | 2 | X | RM | |||||
3 | 2 | 2 | 2 | 3 | 1 | 2 | 2 | 2 | EDF (*) |
overload behaviour