Questions on Round Robin Scheduling
Que1- Calculate the Turn around time and waiting time of the processes on the basis of round robin scheduling algorithm. Assume Time Quantum is set to 2 units. Also calculate the average waiting time and turn around time.
| P No. |
AT |
BT |
| 1 |
0 |
4 |
| 2 |
1 |
5 |
| 3 |
2 |
2 |
| 4 |
3 |
1 |
| 5 |
4 |
6 |
| 6 |
6 |
3 |
Solution-
Ready State : P1 P2 P3 P1 P4 P5 P2 P6 P5 P2 P6 P5
| P No. |
AT |
BT |
CT |
TAT |
WT |
| 1 |
0 |
4 |
8 |
8 |
4 |
| 2 |
1 |
5 |
18 |
17 |
12 |
| 3 |
2 |
2 |
6 |
4 |
2 |
| 4 |
3 |
1 |
9 |
6 |
5 |
| 5 |
4 |
6 |
21 |
17 |
11 |
| 6 |
6 |
3 |
19 |
13 |
10 |
|
|
|
|
67/6=10.8 |
46/6=7.3 |
Que2- Calculate the Turn around time and waiting time of the processes on the basis of round robin scheduling algorithm. Assume Time Quantum is set to 3 units. Also calculate the average waiting time and turn around time.
| P No. |
AT |
BT |
| 1 |
5 |
5 |
| 2 |
4 |
6 |
| 3 |
3 |
7 |
| 4 |
1 |
9 |
| 5 |
2 |
2 |
| 6 |
6 |
3 |
Solution-
Ready State : P4 P5 P3 P2 P4 P1 P6 P3 P2 P4 P1 P3
| P No. |
AT |
BT |
CT |
TAT |
WT |
| 1 |
5 |
5 |
31 |
26 |
21 |
| 2 |
4 |
6 |
29 |
25 |
19 |
| 3 |
3 |
7 |
32 |
29 |
22 |
| 4 |
1 |
9 |
26 |
25 |
16 |
| 5 |
2 |
2 |
5 |
3 |
1 |
| 6 |
6 |
3 |
20 |
14 |
11 |
|
|
|
|
128/6=21.3 |
92/6=15.3 |
Que3- Consider a system with 4 processes P1, P2, P3 & P4 arriving in ready queue in same order at time 0. If the B.T. requirements of these jobs are 4, 1, 8, 1 respectively, then what is completion time of process P1,
Assuming (a) 8 (b) 7
(c) 9 (d) 10
Solution-
Ready State- P1 P2 P3 P4 P1 P3 P1 P3 P1 P3 P1 P3
Gantt Chart-
| P1 |
0 |
4 |
| P2 |
0 |
1 |
| P3 |
0 |
8 |
| P4 |
0 |
1 |
]]>