Download presentation
Presentation is loading. Please wait.
Published byCecilia Harvey Modified over 9 years ago
1
Scheduling Chap 2
2
Scheduling Introduction to Scheduling (1) Bursts of CPU usage alternate with periods of I/O wait –a CPU-bound process –an I/O bound process
3
Introduction to Scheduling Scheduling Algorithm Goals
4
Two Major Types Pre-emptive –O/S can remove a running process. –On the clock or Error Non Pre-Emptive –O/S can not remove a running process –Must complete or Block –DO_EVENTS()
5
Scheduling in Batch Systems An example of first come first served scheduling A arrives at zero and runs til 10. B arrives at one and needs 5 units. C arrives at two and needs 2 units. D arrivers at three and needs 1 unit. A finishes at 10, B at 15, C at 17 and D at 18. Average turnaround is? Average wait is ?
6
Scheduling in Batch Systems An example of shortest job first scheduling A arrives at zero and runs til 10. B arrives at one and needs 5 units. C arrives at two and needs 2 units. D arrivers at three and needs 1 unit. Time line is? Average turnaround is? Average wait is ?
7
Scheduling in Batch Systems An example of shortest time remaining scheduling A arrives at zero and runs til 10. B arrives at one and needs 5 units. C arrives at two and needs 2 units. D arrivers at three and needs 1 unit. Time line is? Average turnaround is? Average wait is ?
8
Scheduling in Batch Systems Three level scheduling
9
Scheduling in Interactive Systems Round Robin Scheduling –list of runnable processes –list of runnable processes after B uses up its quantum
10
Scheduling in Interactive Systems A scheduling algorithm with four priority classes
11
Honesty in Scheduling Who is the owner? Compute ratio –R = CPU units / CPU possible units Lying!
12
Scheduling in Real-Time Systems Schedulable real-time system Given –m periodic events –event i occurs within period P i and requires C i seconds Then the load can only be handled if
13
A problem Arrival Time0123 Process/JobABCD CPU units6314 Draw a time line for each process using FCFS, SJN, SRT, RR quanta of 2. Compute turnaround time and wait time for each process. Compute average turnaround and average wait for each method.
Similar presentations
© 2025 SlidePlayer.com Inc.
All rights reserved.