Consider the following set of processes and the length of CPU burst time given…
2018
Consider the following set of processes and the length of CPU burst time given in milliseconds :
\(\begin{array}{|c|c|} \hline \text{Process} & \text{CPU Burst time (ms)} \\ \hline P_1 & 5 \\ \hline P_2 & 7 \\ \hline P_3 & 6 \\ \hline P_4 & 4 \\ \hline \end{array}\)
Assume that processes being scheduled with Round-Robin Scheduling Algorithm with time quantum 4 ms. Then the waiting time for 𝑃4 is ______ ms
- A.
0
- B.
4
- C.
12
- D.
6
Attempted by 250 students.
Show answer & explanation
Correct answer: C
Solution and calculation:
Assume all processes arrive at time 0. Time quantum = 4 ms.
Gantt timeline (start–end): P1: 0–4, P2: 4–8, P3: 8–12, P4: 12–16 (P4 completes at 16).
Completion time of the process with burst 4 ms = 16 ms.
Turnaround time = completion − arrival = 16 − 0 = 16 ms.
Waiting time = turnaround − CPU burst = 16 − 4 = 12 ms.
Final answer: Waiting time for the process with 4 ms CPU burst is 12 ms.
A video solution is available for this question — log in and enroll to watch it.