So in class, my professor was going over round robin scheduling. Consider this situation:
Job | Arrival | Burst
A | 0 | 3
B | 1 | 5
C | 3 | 4
My professor wrote down the results as follows:
Time
1 2 3 4 5 6 7 8 9 10 11 12
A A B A B B C C B C B C
At times 0-1
, A
has being processed for one burst. At time 1-2
, A
is being processed for another burst. At time 2-3
B
is being processed for a burst, and so on and so forth.
What I'm confused about is at times 6-8
. B
is processed again from time 5-6
. Then C
from time 6-7
, and C
again from time 7-8
. Shouldn't it instead be this:
Time
1 2 3 4 5 6 7 8 9 10 11 12
A A B A B C B C B C B C
At first each and every round robin question is based on quantum.(ex-quantum = 4). It means each and every process will take same quantum time for execution. for your example if quantum=2. then it seems like
A B C A B C B
0 - 2 - A
2 - 4 - B
4 - 6 - C
6 - 7 - A
7 - 9 - B
9 - 11 - c
11 -12 - B
Waiting time of process Waiting time = (starting time of final execution – previous executed cycle – arrival time)
A – (6-2-0)=4
B – (11-(2+2)-1)=6
C – (9-2)-3=4
Average waiting time = (4+6+4)/3 = 14/3 = 4.66