On the context switch, which process to run next, from a 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
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 the cost of context switch (~1 microsecond)
3. 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 the new arrival