Lecture 4
Lecture 4
Lecture 04
CPU Scheduling
•Basic Concepts
•Scheduling Criteria
•Scheduling Algorithms
Objectives
P1 P3 P2 P4
0 3 8 17 24
P1 P3 P2 P4
0 20 24 36 45
P2 P4 P5 P3 P1
0 12 16 22 30 40
P2 P3 P4 P3 P5 P2 P1
0 3 5 9 15 21 30 40
P2 P5 P1 P3 P4
0 1 6 16 18 19
P1 P2 P1 P5 P1 P3 P4
0 1 2 4 9 16 18 19
P1 P2 P3 P4 P5 P1 P2 P4 P1
0 5 10 14 19 24 29 32 37 39
P1 0 5
P2 1 3
P3 2 1
P4 3 2
P5 4 3
RR with Q=3 and arrival time are given
Consider the set of 5 processes whose arrival time and
burst time are given below:
Process Arrival Burst
Time Time
P1 0 5
P2 1 3
P3 2 1
P4 3 2
P5 4 3
Round Robin (RR).. General notes
• Each process gets a small unit of CPU time (time quantum
q), usually 10-100 milliseconds. After this time has
elapsed, the process is preempted and added to the end of
the ready queue.
• Timer interrupts every quantum to schedule next process
• Performance
• q large FIFO (FCFS)
• q small RR
• Note that q must be large with respect to context switch,
otherwise overhead is too high
Thanks for your
attention