160 likes | 174 Views
Explore process scheduling, scheduling modes, criteria, algorithms, and efficient CPU utilization in operating systems. Topics include types of processes, scheduling circumstances, and algorithms like FCFS and SJF. Learn about preemptive and nonpreemptive modes for optimal system performance.
E N D
Process Scheduling(5.1-5.3) CPE 261403 - Operating Systems http://www.e-cpe.org/moodle
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) Figure 3.2
Scheduling Modes Non-Preemptive A A A B B B B A A A Preemptive A A B B A
Scheduling Criteria (5.2) • CPU Utilization (Percent) • Throughput (Processes per time unit) • Turnaround time (time units) • Waiting time (time units) • Response time (time units)
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