Post on 16-Apr-2017
Round Robin Scheduling (RR)
Baljit Singh Saini
Time quantum = 3process Burst time Arrival time
P1 4 0
P2 5 2
P3 3 4
P4 2 5
P10
0
Baljit Singh Saini
At time ZERO P1 is in the system
Time quantum = 3process Burst time Arrival time
P1 4/3 0
P2 5 2
P3 3 4
P4 2 5
P1
1
0
Baljit Singh Saini
At time 1 no new process arrives
Time quantum = 3process Burst time Arrival time
P1 4/2 0
P2 5 2
P3 3 4
P4 2 5
P1
2
0
Baljit Singh Saini
P2
At time 2 P2 arrives
Time quantum = 3process Burst time Arrival time
P1 4/1 0
P2 5 2
P3 3 4
P4 2 5
P1
3
0
Baljit Singh Saini
P2
3
At time 3 no new process arrives
But quantum of P1 expires.So P1 is preempted and P2 gets
the CPU
Time quantum = 3process Burst time Arrival time
P1 4/1 0
P2 5 2
P3 3 4
P4 2 5
P1
3
0
Baljit Singh Saini
3
After time 3 the state of the system is this
P1
P2
Time quantum = 3process Burst time Arrival time
P1 4/1 0
P2 5/4 2
P3 3 4
P4 2 5
P1
4
0
Baljit Singh Saini
3
P2
P1 P3
Time quantum = 3process Burst time Arrival time
P1 4/1 0
P2 5/3 2
P3 3 4
P4 2 5
P1
5
0
Baljit Singh Saini
3
P2
P1 P3 P4
Time quantum = 3process Burst time Arrival time
P1 4/1 0
P2 5/2 2
P3 3 4
P4 2 5
P1
6
0
Baljit Singh Saini
3
P2
P1 P3 P4
6
Time quantum = 3process Burst time Arrival time
P1 4/0 0
P2 5/2 2
P3 3 4
P4 2 5
P1
7
0
Baljit Singh Saini
3
P2 P1
P3 P4
6
P2
7
Time quantum = 3process Burst time Arrival time
P1 4 0
P2 5/2 2
P3 3 4
P4 2 5
P1
7
0
Baljit Singh Saini
3
P2 P1
P3 P4
6
P2
7
Time quantum = 3process Burst time Arrival time
P1 4 0
P2 5/2 2
P3 3/2 4
P4 2 5
P1
8
0
Baljit Singh Saini
3
P2 P1 P3
P4
6
P2
7
Time quantum = 3process Burst time Arrival time
P1 4 0
P2 5/2 2
P3 3/1 4
P4 2 5
P1
9
0
Baljit Singh Saini
3
P2 P1 P3
P4
6
P2
7
Time quantum = 3process Burst time Arrival time
P1 4 0
P2 5/2 2
P3 3/0 4
P4 2 5
P1
10
0
Baljit Singh Saini
3
P2 P1 P3
P4
6
P2
7 10
Time quantum = 3process Burst time Arrival time
P1 4 0
P2 5/2 2
P3 3 4
P4 2 5
P1
10
0
Baljit Singh Saini
3
P2 P1 P3
P4
6
P2
7 10
Time quantum = 3process Burst time Arrival time
P1 4 0
P2 5/2 2
P3 3 4
P4 2/1 5
P1
11
0
Baljit Singh Saini
3
P2 P1 P3
6
P2
7 10
P4
Time quantum = 3process Burst time Arrival time
P1 4 0
P2 5/2 2
P3 3 4
P4 2/0 5
P1
12
0
Baljit Singh Saini
3
P2 P1 P3
6
P2
7 10
P4
12
Time quantum = 3process Burst time Arrival time
P1 4 0
P2 5/2 2
P3 3 4
P4 2 5
P1
12
0
Baljit Singh Saini
3
P2 P1 P3
6
P2
7 10
P4
12
Time quantum = 3process Burst time Arrival time
P1 4 0
P2 5/1 2
P3 3 4
P4 2 5
P1
13
0
Baljit Singh Saini
3
P2 P1 P3
6 7 10
P4
12
P2
Time quantum = 3process Burst time Arrival time
P1 4 0
P2 5/0 2
P3 3 4
P4 2 5
P1
14
0
Baljit Singh Saini
3
P2 P1 P3
6 7 10
P4
12
P2
14
Time quantum = 3process Burst time Arrival time
P1 4 0
P2 5 2
P3 3 4
P4 2 5
P1
14
0
Baljit Singh Saini
3
P2 P1 P3
6 7 10
P4
12
P2
14
Time quantum = 3process Burst time Arrival time
P1 4
P2 5 2
P3 3 4
P4 2 5
P1
0
Baljit Singh Saini
3
P2 P1 P3
6 7 10
P4
12
P2
14
Waiting time
P1 =
0
0 - 0 + 3 = 3
P1 waiting for next burst
P2= 3 - 2 + 6 = 7
P2 waiting for next burst
2
P3 =7 – 4 = 3P4 = 10 – 5 = 5