Professional Documents
Culture Documents
• Basic Concepts
• Scheduling Criteria
• Scheduling Algorithms
– Uniprocessor (single-core) scheduling
– Multiprocessor (multi-core) scheduling
4. 2. 5.
In which case(s)
does CPU
scheduling have
to occur in order
to keep the CPU
cores busy?
3. 1. Answer:
Only 1 and 5
System-wide Objectives:
1. Max. CPU Utilization: Keep the CPU as busy as
possible
– Percentage of time during which the CPU
cores are busy executing processes.
– (Sum of execution time on each core) divided
by (total time multiplied by number of cores)
2. Max. Throughput: Number of processes that
complete their execution per unit of time
– Number of “exit” transitions per unit of time
Operating Systems 3.6 Part 3 Process Scheduling
Scheduling Objectives (Cont.)
Individual Process Objectives:
1. Min. Turnaround Time: Amount of time to
execute a particular process, i.e., from the time of
creation to the time of termination
– Time elapsed between “admitted” and “exit”
transitions for a process
– Average over all processes is denoted as
average turnaround time
0 24 27 30
0 3 6 30
• Two schemes:
1. Nonpreemptive: Once core is given to a process, it
cannot be preempted until it completes its CPU burst
2. Preemptive (also known as Shortest Remaining-Time
First or SRTF): If a newly created process has CPU
burst length less than the remaining CPU burst of
currently running process, then preemption will occur
0 3 7 8 12 16
P1 P2 P3 P2 P4 P1
0 2 4 5 7 11 16
P1 P2 P3 P4
• Performance:
– n processes in ready queue implies waiting time
is no more than (n-1)q time units
– Large q: Degenerates to FCFS
– Small q: Many context switches; high overhead
Operating Systems 3.17 Part 3 Process Scheduling
Example: RR with Time Quantum = 20
Process Burst Time
P1 53 33
P2 17 0
P3 68 48
P4 24 4
• No well-defined
relationship
between average
turnaround time
and quantum size
Assume arrival
order is P1, P2, • Average
P3, P4 all at time 0 turnaround time
remains fixed
once quantum
size is larger than
maximum CPU
burst length
Core 1 P1 P3 P1
Core 2 P2 P4
0 2 4 5 6 8 10
P1 P2 P3 P4
P2 17 0
P3 68 48 28 0
P4 24 4 0
P1 P4 P3 P1
Core 1
Core 2 P2 P3 P1 P4 P3
0 17 37 57 61 89
Operating Systems 3.28 Part 3 Process Scheduling
Global Scheduling: Issues