Comprehension

Consider the following set of processes with the arrival time and length of CPU burst time given in milli secends (ms)
Process Arrival Time Burst Time
P1 0 5
P2 2 3
P3 2 2
P4 5 3
P5 6 1

Find the average weighted turnaround time for these process using Highest Response Ratio Next (HRN) Algorithm?

  1. 3.2 ms
  2. 2.834 ms
  3. 1.632 ms
  4. 6.721 ms

Answer (Detailed Solution Below)

Option 2 : 2.834 ms

Detailed Solution

Download Solution PDF

The correct answer is option 2.

CONCEPT:

Highest Response Ratio Next (HRN):

HRN is a non-preemptive scheduling algorithm where the process with the highest response ratio is selected next. The response ratio is calculated as:

Response Ratio = (Waiting Time + Burst Time) / Burst Time

Formula:

Turnaround Time (TAT) = Completion Time (CT) - Arrival Time (AT)

Weighted TAT = Turnaround Time / Burst Time

Steps:

  1. Select the process with the highest response ratio among all arrived processes.
  2. Compute completion time, TAT, and weighted TAT.
  3. Repeat until all processes are scheduled.

Calculated weighted turnaround times:

Process AT BT CT TAT WTAT
P1 0 5 5 5 1.00
P3 2 2 7 5 2.5
P2 2 3 10 8 2.67
P4 5 3 13 8 2.67
P5 6 1 14 8 8.0

Average Weighted Turnaround Time = \({{1+ 2.5+2.67+2.67+8} \over 5 } = 2.834\)

∴ Hence, the correct answer is 2.834 ms

More Process Scheduling Questions

More CPU Scheduling Questions

Get Free Access Now
Hot Links: teen patti master downloadable content teen patti real cash withdrawal teen patti wealth teen patti rummy 51 bonus