Welcome! Log In Create A New Profile

Advanced

Round Robin

Posted by Cornelvdw 
Announcements Last Post
Announcement SoC Curricula 09/30/2017 01:08PM
Announcement Demarcation or scoping of examinations and assessment 02/13/2017 07:59AM
Announcement School of Computing Short Learning Programmes 11/24/2014 08:37AM
Announcement Unisa contact information 07/28/2011 01:28PM
Round Robin
October 21, 2008 09:42PM
Can somebody please explain this one to me, I have worked though all the examples but I just can’t get me head around this one…
Re: Round Robin
October 22, 2008 03:48PM
O.k I am still stuck with this one, I must be missing something here because this is the only algorithm that is getting me down ....
Re: Round Robin
October 22, 2008 04:59PM
Hi Cornel,

See if this helps:

In RR, you get given a quantum value, which is how long each process can hold the processor before it makes way for another. Call it a timeslot.

Have a look at p 164
P1 = 24
P2 = 3
P3 = 3
quantum = 4

So first P1 gets a turn, then P2, then P3, and then it repeats.

P2 and P3 are only 3ms each, so they finish before the quantum expires. If this happens, you start counting from 0 again, so when P1 gets its 2nd turn, it gets a quantum of 4.

Thats the easy part.

Now they add arrival times.
eg.
P1 : arr=0 burst=3
P2 : arr=1 burst=6
P3 : arr=3 burst=9
P4 : arr=6 burst=1
quantum = 1

All that changes is that you check the arrival time at the end of each quantum and add the new process(es) to the queue.
NB(1) A new process that arrives, gets placed at the back of the queue.
NB(2) A process just arriving is given preference to a job just finishing its quantum.

t0:
queue = P1
gantt = P1

t1:
P2 arrives at t1 just as P1 finishes, thus it goes before P1
queue = P2,P1
gantt = P1,P2

t2:
P2 gets placed at the back of the queue
queue = P1,P2
gantt = P1,P2,P1

t3:
P3 arrives and P1 goes to the back of the queue
queue = P2,P3,P1
gantt = P1,P2,P1,P2

t4:
P2 goes to the back of the queue
queue = P3,P1,P2
gantt = P1,P2,P1,P2,P3

t5:
P3 goes to back of queue
queue = P1,P2,P3
gantt = P1,P2,P1,P2,P3,P1
P1's 3 bursts used up, so P1 is finished

t6:
P4 arrives, goes to back of queue
queue = P2,P3,P4
gantt = P1,P2,P1,P2,P3,P1,P2

t7:
P2 goes to back of queue
queue = P3,P4,P2
gantt = P1,P2,P1,P2,P3,P1,P2,P3

etc..
Re: Round Robin
October 22, 2008 10:08PM
Thnx Eugene

I think I got it now, just hope if I don’t get the Gantt chart correct that I will loose points on the relating questions eg. Turn Around Time etc.

GOOD LUCK TO ALL !!
Sorry, only registered users may post in this forum.

Click here to login