TurnAround Time = Completion Time – Arrival Time.

WaitingTime = TurnAroungTime – BurstTime

WaitingTime = TurnAroungTime – BurstTime

Dark Mode

2,350 views

1 vote

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 $P_4$ is ______ ms

- $0$
- $4$
- $12$
- $6$

0 votes

Assume all the processes are arriving at $0$ ms.

$ \begin{array} {|c|c|c|c|c|c|} \hline \textbf{Process} & \textbf{Arrival Time} & \textbf{Burst Time} & \textbf{Completion Time} & \textbf{Turn Around Time} & \textbf{Watting time} \\\hline P_{1} & 0 & 5 & 17 & 17 & 12 \\\hline \ P_{2} & 0 & 7 & 20 & 20 & 13 \\\hline \ P_{3} & 0 & 6 & 22 & 22 & 16 \\\hline \ P_{4} & 0 & 4 & 16 & 16 & 12 \\\hline \end {array}$

Gannt chart is as follows:

$\begin{array} {|c|c|c|c|c|} \hline P_1 & P_2 & P_3 & P_4 & P_1 & P_2 & P_3 \\ {0-4} & 4-8 & 8-12 & 12-16 & 16-17 & 17-20 & 20-22 \\\hline \end{array}$

So the waiting time of process $P_4$ is $12$ ms.

$ \begin{array} {|c|c|c|c|c|c|} \hline \textbf{Process} & \textbf{Arrival Time} & \textbf{Burst Time} & \textbf{Completion Time} & \textbf{Turn Around Time} & \textbf{Watting time} \\\hline P_{1} & 0 & 5 & 17 & 17 & 12 \\\hline \ P_{2} & 0 & 7 & 20 & 20 & 13 \\\hline \ P_{3} & 0 & 6 & 22 & 22 & 16 \\\hline \ P_{4} & 0 & 4 & 16 & 16 & 12 \\\hline \end {array}$

Gannt chart is as follows:

$\begin{array} {|c|c|c|c|c|} \hline P_1 & P_2 & P_3 & P_4 & P_1 & P_2 & P_3 \\ {0-4} & 4-8 & 8-12 & 12-16 & 16-17 & 17-20 & 20-22 \\\hline \end{array}$

So the waiting time of process $P_4$ is $12$ ms.