What is the problem

You’ll be given a list of processes (P1, P2, P3, …), their arrival time, and burst time, and the RR time quantum (Q).

You’ll be expected to figure out the sequence in which each process runs.

Based on that, you’ll be asked questions about a process.
(Ex): What’s the turnabout time for P2?

Before you begin

I'll demonstrate on this example

Time Quantum () = 2

  1. draw a straight line that’ll act as the time axis, and place ticks on it in multiples of Q and until the scheduling ends (the sum of the burst time of each process).
    (Q=2 | ends at t=6+8+7+3=23)

Note

Make sure u leave generous space between each tick.

  1. for every process, add it below the timestamp at which it arrived. (add ticks when needed)
  2. initialize an empty queue at time 0.
  3. follow the strategy below.

The keys

Symbols Key

Notation Key

The Strategy

(I’m still using that example in the demonstration)

  1. starting with the process that arrived first (P1), run it and indicate that below the timeline.
    (it’ll run for Q=2)
    (as it runs, if a new process arrived, add it to the bottom of the queue and also indicate how much burst time is left for it)
    (P2 arrived at t=2)
  2. As the Q runs out (t=2), if P1 still didn’t finish, add it to the bottom of the queue with its remaining time, and then pop P2 out of the queue (do this in your head) and run it.
  3. It’s t=4, Q ran out again and P2 didn’t finish: add P2 back to the queue and run P1. (P3 arrived at t=5)
  4. It’s t=6, Q ran out and P1 didn’t finish: add P1 back to the queue and run P2. (P4 arrived at t=7)
  5. It’s t=8, Q ran out and P2 didn’t finish: add P2 back to the queue and run P3.
  6. keep doing this until no process remains in the queue… (this how the final diagram should look like)

Connections