Download presentation
Presentation is loading. Please wait.
Published byชนิภรณ์ สโตเกอร์ Modified over 6 years ago
1
Lecture 24: Process Scheduling Examples and for Real-time Systems
2
Review: Categories of Process Scheduling
Batch Systems (Compute Servers) Many processes, not interactive, throughput is important Interactive Systems PC Real Time Systems Guaranteed response times, meet deadlines
3
Scheduling Algorithm Goals
All Systems Fairness – giving each process a fair share of the CPU Policy enforcement – seeing that stated policy is carried out Balance – keeping all parts of the system busy
4
Review: Scheduling Algorithms for Batch Systems
First come first serve Shortest job first Shortest remaining time next
5
Review: Scheduling Algorithms for Interactive Systems
Round-Robin scheduling Priority scheduling Multiple queues Lottery scheduling
6
FCFS Arrival time CPU burst P1: 4 36 8 112 1 13 I/O burst 16
13 16 20 P1: I/O burst P2: P3: P4:
7
FCFS 13 16 20 P1: P2: P3: P4: Which process goes next? P1 idle P2 P3 P4
8
FCFS Time next ready 40 76 60 192 13 16 20 P1: P2: P3: P4: Which process goes next? P1 idle P2 P3 P4
9
FCFS Time next ready 40 76 60 192 13 16 20 P1: P2: P3: P4: P1 idle P2 P3 P4 P1 idle P3
10
FCFS 162 76 212 192 13 16 20 P1: P2: P3: P4: P1 idle P2 P3 P4 P1 idle P3 P P idle P4
11
RR, Q = 10 Arrival time CPU burst P1: 4 36 8 112 1 13 I/O burst 16
13 16 20 P1: I/O burst P2: P3: P4: Gantt chart
12
RR, Q = 10 13 16 20 P1: P2: P3: P4: Which process goes next, and when? Gantt chart P1 idle P2 P3 P4
13
RR, Q = 10 40 82 47 179 13 16 20 P1: P2: P3: P4: Gantt chart P1 idle P2 P3 P4 P2
14
RR, Q = 10 162 End Run 179 13 16 20 P1: P2: P3: P4: Gantt chart P1 idle P2 P3 P4 P2 P1 P3 P2 P3
15
RR, Q = 10 End 205 179 13 16 20 P1: P2: P3: P4: Gantt chart P1 idle P2 P3 P4 P2 P1 P3 P2 P3 P1 P3 idle
16
MLFQ: Q0 = 8, Q1 = 16, Q2 = 40 q1 45 177 13 16 20 P1: P2: 15 P3: P4: Gantt chart 1 idle
17
MLFQ: Q0 = 8, Q1 = 16, Q2 = 160 q1 177 13 16 20 P1: P2: 2 P3: 104 P4: Gantt chart 1 idle
18
MLFQ: Q0 = 8, Q1 = 16, Q2 = 160 98 q2 177 13 16 20 P1: P2: P3: 64 P4: Gantt chart 1 idle
19
MLFQ: Q0 = 8, Q1 = 16, Q2 = end q2 190 13 16 20 P1: P2: P3: 4 P4: Gantt chart 1 idle idle
20
Real-time Scheduling Definition Performance measure Key property
Systems whose correctness depends on their temporal aspects as well as their functional aspects Performance measure Timeliness on timing constraints (deadlines) Speed/average case performance are less significant. Key property Predictability on timing constraints
21
Real-time Scheduling Absolute deadline Released Execution time
Relative deadline
22
Deadlines: Hard vs. Soft
Hard deadline Disastrous or very serious consequences may occur if the deadline is missed Validation is essential : can all the deadlines be met, even under worst-case scenario? Deterministic guarantees Soft deadline Ideally, the deadline should be met for maximum performance. The performance degrades in case of deadline misses. Best effort approaches / statistical guarantees
23
RM (Rate Monotonic) Optimal static-priority scheduling
It assigns priority according to period A task with a shorter period has a higher priority Executes a job with the shortest period T1 (4,1) T2 (5,2) 5 10 15 T3 (7,2)
24
EDF (Earliest Deadline First)
Optimal dynamic priority scheduling A task with a shorter deadline has a higher priority Executes a job with the earliest deadline T1 (4,1) T2 (5,2) 5 10 15 T3 (7,2)
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.