Three processes P1, P2, and P3 arrive at time 0 with CPU burst times of 12 ms,…

2024

Three processes P1, P2, and P3 arrive at time 0 with CPU burst times of 12 ms, 8 ms, and 3 ms respectively. Using the Round Robin scheduling algorithm with a time quantum of 5 ms, what is the total waiting time experienced by process P3 (the process with the 3 ms burst)?

  1. A.

    7 milliseconds

  2. B.

    10 milliseconds

  3. C.

    13 milliseconds

  4. D.

    18 milliseconds

Attempted by 33 students.

Show answer & explanation

Correct answer: B

Concept: Round Robin scheduling gives every process one time-quantum turn in cyclic queue order. A process's waiting time before its own first turn equals the sum of the quantum slices used by the processes ahead of it in the initial queue, and once its completion time is known, waiting time = turnaround time − burst time (turnaround = completion − arrival).

Application: Time quantum = 5 ms. Initial queue order: P1 (12 ms), P2 (8 ms), P3 (3 ms), all arriving at t = 0.

  1. t = 0 to 5 ms: P1 takes its first quantum, using 5 of its 12 ms; 7 ms remain and P1 rejoins the back of the queue.

  2. t = 5 to 10 ms: P2 takes its first quantum, using 5 of its 8 ms; 3 ms remain and P2 rejoins the back of the queue.

  3. t = 10 to 13 ms: P3 gets its turn. Its entire 3 ms burst fits inside one quantum, so it finishes completely at t = 13 ms.

  4. P3 needs no further turn: completion = 13 ms, arrival = 0, so turnaround = 13 ms, and waiting time = turnaround − burst = 13 − 3 = 10 ms.

Cross-check: By queue position alone, P3 is third in the initial queue, so before its own first turn it must wait out one full quantum from each of the two processes ahead of it — 5 ms + 5 ms = 10 ms — matching the turnaround-based calculation above.

Process

Burst (ms)

Completion (ms)

Turnaround (ms)

Waiting (ms)

P1

12

23

23

11

P2

8

21

21

13

P3

3

13

13

10

Result: Process P3's total waiting time is 10 ms.

Explore the full course: Niacl Ao It Specialist