0% found this document useful (0 votes)
64 views

Lecture 5: Scheduling Policies: Mythili Vutukuru IIT Bombay

This document discusses different CPU scheduling policies used by operating systems to determine which ready process should run next. It describes the goals of scheduling policies as maximizing CPU utilization, minimizing average turnaround and response times, and ensuring fairness. The scheduling policies covered are First-In-First-Out (FIFO), Shortest Job First (SJF), Shortest Time-to-Completion First (STCF), and Round Robin (RR). Real systems often use more complex schedulers like Linux's Multi Level Feedback Queue approach.

Uploaded by

sukhna lake
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
64 views

Lecture 5: Scheduling Policies: Mythili Vutukuru IIT Bombay

This document discusses different CPU scheduling policies used by operating systems to determine which ready process should run next. It describes the goals of scheduling policies as maximizing CPU utilization, minimizing average turnaround and response times, and ensuring fairness. The scheduling policies covered are First-In-First-Out (FIFO), Shortest Job First (SJF), Shortest Time-to-Completion First (STCF), and Round Robin (RR). Real systems often use more complex schedulers like Linux's Multi Level Feedback Queue approach.

Uploaded by

sukhna lake
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Lecture 5: Scheduling Policies

Mythili Vutukuru
IIT Bombay
What is a scheduling policy?
• On context switch, which process to run next,
from set of ready processes?
• OS scheduler schedules the CPU requests
(bursts) of processes
– CPU burst = the CPU time used by a process in a
continuous stretch
– If a process comes back after I/O wait, it counts as
a fresh CPU burst

2
What are we trying to optimize?
• Maximize (utilization = fraction of time CPU is
used)
• Minimize average (turnaround time = time from
process arrival to completion)
• Minimize average (response time = time from
process arrival to first scheduling)
• Fairness: all processes must be treated equally
• Minimize overhead: run process long enough to
amortize cost of context switch (~1 microsecond)

3
First-In-First-Out (FIFO)

• Example: three
processes arrive
at t=0 in the order
A,B,C

• Problem: convoy
effect
• Turnaround times
tend to be high
4
Shortest Job First (SJF)
• Provably optimal
when all processes
arrive together.

• SJF is non-
preemptive, so
short jobs can still
get stuck behind
long ones.
5
Shortest Time-to-Completion First
(STCF)
• Also called
Shortest
Remaining Time
First (SRTF)
• Preemptive
scheduler
• Preempts running
task if time left is
more than that of
new arrival
6
Round Robin (RR)
• Every process
executes for a fixed
quantum slice
• Slice big enough to
amortize cost of
context switch
• Preemptive
• Good for response
time and fairness
• Bad for turnaround
time
7
Schedulers in real systems
• Real schedulers are more complex
• For example, Linux uses a Multi Level Feedback
Queue (MLFQ)
– Many queues, in order of priority
– Process from highest priority queue scheduled first
– Within same priority, any algorithm like RR
– Priority of process decays with its age

You might also like