1. CPU Scheduling
-
policies, metrics, performance, fairness, preemptive vs. non-preemptive
turnaround time = time from arrival to completion
FIFO - First In, First Out
2. SJF - Shortest Job First
-
STCF - Shortest Time-to-Completion First
3. RR - Round-Robin
-
response time = wait time from arrival to first scheduled
time slice = scheduling quantum
4. Overlap
-
In general the run-times of jobs are not known in advance
--> multi-level feedback queue
5. Exercises
-
Exercises from the book using scheduler.py:
1. Compute the response time and turnaround time when running three jobs of length 200 with the SJF and FIFO schedulers.
2. Now do the same but with jobs of different lengths: 100, 200, and 300.
3. Now do the same, but also with the RR scheduler and a time-slice of 1.
4. For what types of workloads does SJF deliver the same turnaround times as FIFO?
5. For what types of workloads and quantum lengths does SJF deliver the same response times as RR?
6. What happens to response time with SJF as job lengths increase? Can you use the simulator to demonstrate the trend?
7. What happens to response time with RR as quantum lengths increase? Can you write an equation that gives the worst-case response time, given N jobs?