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 "critical instant": largest response time
T | C | U | Priority | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | ||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | 10 | 2 | 0.2 | Arrival | 1 | 1 | |||||||||
2 | 5 | 2 | 0.4 | 2 | 2 | 2 | 2 | ||||||||
3 | 3 | 1 | 1/3 | 3 | 3 | 3 | 3 | ||||||||
Service | 3 > 2 > 1 (frequency) | 3 | 2 | 2 | 3 | 1 | 2 | 3 | 2 | 1 | 3 | ||||
2 > 3 > 1 (utilization) | 2 | 2 | 3 | 3 | 1 | 2 | 2 | 3 | 1 | 3 | |||||
1 > 2 > 3 (period) | 1 | 1 | 2 | X |
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 | Schedule | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | ||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | 8 | 1 | 0.125 | Arrival | 1 | 1 | ||||||||
2 | 5 | 3 | 0.6 | 2 | 2 | 2 | 2 | 2 | 2 | |||||
3 | 4 | 1 | 0.25 | 3 | 3 | 3 | ||||||||
Service | RM | 3 | 2 | 2 | 2 | 3 | 2 | 2 | 2 | X | ||||
EDF (*) | 3 | 2 | 2 | 2 | 3 | 1 | 2 | 2 | 2 |
overload behaviour