scheduling chap 2. scheduling introduction to scheduling (1) bursts of cpu usage alternate with...
TRANSCRIPT
SchedulingIntroduction to Scheduling (1)
• Bursts of CPU usage alternate with periods of I/O wait– a CPU-bound process– an I/O bound process
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()
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 ?
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 ?
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 ?
Scheduling in Interactive Systems
• Round Robin Scheduling– list of runnable processes– list of runnable processes after B uses up its quantum
Honesty in Scheduling
• Who is the owner?
• Compute ratio– R = CPU units / CPU possible units
• Lying!
Scheduling in Real-Time Systems
Schedulable real-time system
• Given–m periodic events
– event i occurs within period Pi and requires Ci seconds
• Then the load can only be handled if
1
1m
i
i i
C
P