>_
EngineeringNotes
← Back to OS Internals
Chapter 07

Process Scheduling

Allocating CPU resources efficiently to maximize productivity and minimize waiting times.

01

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.

Done by STS (Short Term Scheduler)
02

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.

Starvation → Non-Preemptive ↑↑
Category 02

Preemptive

CPU is taken away from a process after time quantum expires along with terminating or switching to wait-state.

CPU Utilization Preemptive ↑↑
Overhead Preemptive ↑↑

* Due to continuous switching in context

03

Goals of CPU Scheduling

Maximize
  • 1
    CPU Utilization
  • 2
    Throughput(no. of processes completed per unit time)
Minimize
  • 3
    TAT (TurnAround Time)
  • 4
    WT (Waiting Time)
  • 5
    Response Time