Scheduling Flashcards
when do scheduling decisions happen?
transitions to ready, waiting, terminated
non-preemptive on waiting/terminated only
goals of a scheduling algorithm
high throughput
low turnaround time
low response time
what’s throughput
of processes that finish per unit time
what’s turnaround time
length of time it takes for a process to finish
what’s response time
length of time between request and first response
what are the factors controlling throughput?
cpu/io device utilization
what controls turnaround/response time?
waiting time
what’s cpu utilization?
fraction of time CPU does productive work
what’s waiting time?
time each process waits in the ready queue
FCFS convoy effect?
a job with a long CPU burst prevents many shorter jobs after it from running
what is a consequence of the FCFS convoy effect?
no IO requests are issued, so there is poor IO device utilization
SJF
estimate the next CPU burst and run the process with the shortest one
what’s SRTF?
preemptive SJF scheme: if a process arrives with a shorter burst than the remaining current time, preempt the current process and run the new one
what does SJF optimize?
minimum average waiting time
minimum response time
disadvantage of SJF?
starves jobs with longer burst times
does not minimize avg turnaround time (long job of short bursts)
what’s RR?
pick a quantum and preempt processes that run for longer, moving to the back of a FIFO queue
advantages of RR?
fair allocation of CPU across all jobs
low avg waiting time w/ varying lengths
short jobs finish quickly
good responsiveness with few jobs
disadvantages of RR?
does worse than FCFS for same-sized jobs
context switch costs
direct costs of a context switch?
save/restore registers for syscall
switch address spaces i.e. page table
indirect costs of a context switch?
more misses in cache, TLB, file system’s buffer cache
what condition on the quantum minimizes avg turnaround time?
quantum geq most process times