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..