120 likes | 523 Views
CPU scheduling is crucial in multiprogrammed systems, improving computer productivity by switching among processes efficiently. Learn about CPU bursts, schedulers, dispatchers, scheduling criteria, and popular algorithms including First-Come, First-Served, Shortest-Job-First, and Priority.
E N D
INTRODUCTION CPU scheduling is the basis of multiprogrammed operating system. By switching the CPU among processes, the operating system can make the computer more productive
CPU – I/O Burst Cycle CPU Scheduler Preemptive / Nonpreemptive Scheduling
DISPATCHER • Switching context • Switching to user mode • Jumping to the proper location in the user program to restart that program
Scheduling Criteria • CPU utilization • Throughput • Turnaround time • Waiting time • Response time
SCHEDULING ALGORITHMS • First-Come , First-Served Scheduling Gantt chart: 24 27 30 0 Average waiting time: (0+24+27)/3 =17
Shortest-Job-First Scheduling Gantt chart: 0 3 9 16 24 Average waiting time: (3+16+9+0) / 4 = 7
Priority Scheduling Gantt chart: 0 1 6 16 18 19
Waiting Time: P1 = 6 P2 = 0 P3 = 16 P4 = 18 P5 = 1 Average waiting time: 8.2 milliseconds