Process Scheduling
Allocating CPU resources efficiently to maximize productivity and minimize waiting times.
What is Process Scheduling?
Basis of multi-programming OS.
By switching CPU among processes, the OS can make the computer more productive.
Many processes are kept in memory at a time; when a process must wait or time quantum expires, the OS takes the CPU away from that process & gives the CPU to another process.
CPU Scheduler
Whenever the CPU becomes idle, OS must select one process from ready queue to be executed.
Preemptive & Non-Preemptive
Category 01
Non-Preemptive
Once CPU has been allocated to a process, the process keeps the CPU until its release CPU either by terminating or by switching to wait-state.
Category 02
Preemptive
CPU is taken away from a process after time quantum expires along with terminating or switching to wait-state.
* Due to continuous switching in context
Goals of CPU Scheduling
- 1CPU Utilization
- 2Throughput(no. of processes completed per unit time)
- 3TAT (TurnAround Time)
- 4WT (Waiting Time)
- 5Response Time