Scheduling Objectives
• Fair (nobody cries)
• Priority (lady first)
• Efficiency (make best use of equipment)
• Encourage good behavior (good boy/girl)
• Support heavy load (degrade gracefully)
• Adapt to different environment
(interactive, real‐time, multi‐media, etc.)
Performance Criteria
• Throughput: # of jobs that complete in unit
time
• Turnaround time (also called elapse time)
– Amount of time to execute a particular process
from the time it entered
• Waiting time
– amount of time process has been waiting in
ready queue
• Meeting deadlines: avoid bad consequences
Different Systems, Different Focuses
• Batch Systems (e.g., billing, accounts
receivable, accounts payable, etc.)
– Max throughput, max CPU utilization
• Interactive Systems (e.g., our PC)
– Min. response time
• Real‐time system (e.g., airplane)
– Priority, meeting deadlines
• Example: on airplane, Flight Control has strictly
higher priority than Environmental Control
Program Behaviors Considered in
Scheduling
• Is it I/O bound? Example?
• Is it CPU bound? Example?
• Batch or interactive environment
• Priority
• Frequency of page fault
• Frequency of I/O
Preemptive vs. Non‐preemptive
• Non‐preemptive scheduling
– The running process keeps the CPU until it
voluntarily gives up the CPU
• Process exits
• Switch to blocked state
• 1 and 4 only (no 3 unless
calls yield)
• Preemptive scheduling
– The running process can be interrupted and must
release the CPU
Scheduling Algorithms
• First Come First Serve (FCFS)
• Short Job First (SJF)
• Priority Scheduling
• Round Robin
• Multi‐Queue & Multi‐Level Feedback
• Earliest Deadline First Scheduling
CS317 Operating Systems 12
Batch
Systems
Interactive
Systems
Real‐time
Systems
First Come First Serve (FCFS)
• Also called first‐in first‐out (FIFO)
– Jobs are scheduled in order of arrival to ready
queue
– “Real‐world” scheduling of people in lines (e.g.,
supermarket)
– Typically non‐preemptive (no context switching at
market)
– Jobs treated equally, no starvation