CPU Scheduling
CPU scheduling is a process which allows one process to use the CPU while the execution of another process is on hold(in waiting state) due to unavailability of any resource like I/O etc, thereby making full use of CPU. The aim of CPU scheduling is to make the system efficient, fast and fair.Scheduling Criteria
CPU utilization
– keep the CPU as busy as possibleThroughput
– no. of processes that complete their execution per time unitTurnaround time
– amount of time to execute a particular processWaiting time
– amount of time a process has been waiting in the ready queueResponse time
– amount of time it takes from when a requestScheduling Algorithm Optimization Criteria
Max CPU utilizationMax throughput
Min turnaround time
Min waiting time
Min response time
Scheduling Algorithms
First in first outShortest remaining time
Fixed priority (pre-emptive) scheduling
Round-robin scheduling
Multilevel queue scheduling
Overview
Scheduling algorithm | CPU Overhead | Throughput | Turnaround time | Response time |
---|---|---|---|---|
First In First Out | Low | Low | High | Low |
Shortest Job First | Medium | High | Medium | Medium |
Priority based scheduling | Medium | Low | High | High |
Round-robin scheduling | High | Medium | Medium | High |
Multilevel Queue scheduling | High | High | Medium | Medium |