120 likes | 135 Views
Learn about CPU-bound and I/O-bound processes, scheduling criteria, algorithms like FCFS and SJF, and prediction methods for CPU burst times. Explore different scheduling modes and circumstances in operating systems.
E N D
Process Scheduling(5.1-5.3) Nov 16, 2007 CPE 261403 - Operating Systems http://groups.google.com/group/cpe-os cpe-os@googlegroups.com
The Assumption that Makes Multiprogramming Work • CPU-Bound Process • I/O-Bound Process Figure 5.1
Process Scheduling Figure 3.6
Scheduling Circumstances (5.1.3) 5 2 4 1 3 Figure 3.2
Scheduling Modes • Nonpreemptive (Cooperative) • Windows 3.x • MacOS ( v.9 and earlier) • Preemptive • Windows 95 and later • MacOS X
Scheduling Criteria (5.2) • CPU Utilization • Throughput • Turnaround time • Waiting time • Response time
P1 P2 P3 0 24 27 30 First-Come, First-Serve (FCFS) ProcessBurst Time P1 24 P2 3 P3 3 • Waiting time for P1 = 0; P2 = 24; P3 = 27 • Average waiting time: (0 + 24 + 27)/3 = 17
P2 P3 P1 0 3 6 30 First-Come, First-Serve (FCFS) • P2, P3, P1 Waiting time for P1 = 6; P2 = 0; P3 = 3 Average waiting time: (6 + 0 + 3)/3 = 3
Shortest-Job-First Scheduling (SJF) • SJF is optimal – gives minimum average waiting time • Two schemes: • Nonpreemptive • Preemptive (shortest-remaining-time-first)
Predicting CPU Burst Time Exponential Average
Prediction Example Actual Prediction Figure 5.3