recategorized by
621 views
5 votes
5 votes
Consider the set of processes whose arrival times and burst times (in milliseconds) are given below:
$$\begin{array}{|c|c|c|} \hline \textbf{Process Name} & \textbf{Arrival Time} & \textbf{Execution Time}\\
\hline P_{1} & 0 & 8 \\
P_{2} & 1 & 4\\
P_{3} & 2 & 6\\
P_{4} & 5 & 5\\
\hline \end{array}$$
Using highest response ratio next scheduling algorithm, the average turn around time in milliseconds for the processes will be ________ (up to two decimal points)
recategorized by

1 Answer

8 votes
8 votes
Response Ratio $ = \dfrac{\text{Waiting Time + Burst Time}}{\text{ Burst Time}}$

Highest Response Ratio Next (HRRN) is a non-preemptive scheduling algorithm and so we have to see the response ratio for every process completion.

Initially, only $P_1$ is there. So, it completes its execution for $0-8$

At $8\;\text{ms},$ the Response Ratios are as follows:

$$\begin{array}{|c|c|c|} \hline P_2 &P_3&P_4 \\\hline \frac{7+4}{4}=2.75&\frac{6+6}{6}=2&\frac{3+5}{5}=1.6\\\hline\end{array}$$

So, $P_2$ executes from $8-12.$

At $12\text{ms},$ the Response Ratios are as follows:
$$\begin{array}{|c|c|} \hline P_3&P_4 \\\hline \frac{10+6}{6}=2.667&\frac{7+5}{5}=2.4\\\hline\end{array}$$
So, $P_3$ executes from $12-18,P_4$ executes from $18-23.$

Turnaround time is the time interval from the time of submission of a process to the time of completion of the process.

So, average turn around time $ = \dfrac{[8-0] + [12-1] + [18-2] + [23-5]}{4} = \dfrac{53}{4}=13.25.$
edited by
Answer:

Related questions