FOR FREE CONTENT

Highest Response Ratio Next (HRRN):

 

The HRRN policy computes the response ratios of all processes in the system according to the response ratio and selects the process with the highest response ratio:

 

 

R = Response ratio

W = Time spent waiting for the processor

S = Expected service time (Burst Time)

Mode: Non Preemptive

 

# HRRN not only favors shorter jobs but also limits the waiting time of longer jobs.

 

 

Gantt Chart

Initially, P0 gets the CPU and completes till the end (Because HRRN is non-preemptive), after completion of P0, only P1 in the completes ready queue then complete P1 till the end. 

 

Gantt Chart; Scheduling

 

 

Ready Queue

 

 

At time 10 after completion of P1, all the remaining processes are in the Ready queue (ready to execute). 

Now we calculate the Response Rate of P2, P3, and P4.

 

Now at this moment Waiting Time = First Response – Arrival Time   

[As we know at non-preemptive Waiting Time = Response Time] 

 

P2 = 10 – 5 = 5,   P3 = 10 – 6 = 4,   P4 = 10 – 8 = 2           

 

 

Now, RR(P4) = 2 is larger so, P4 will get CPU first.

 

 

# Again after completion of  P4 at 12, calculate the Response Ratio of the remaining processes to decide which one goes first.

 

Waiting time:

 

P2 = 12 - 5 = 7, P3 = 12 - 6 = 6 

 

 

Now, the Response Ratio (2.2) of P3 is highest so, P3 will schedule first then remaining process P2 will schedule.

 

 

Now we calculate Turn Around Time (TAT) and Waiting Time (WT) using the following formula:

 

TAT = CT - AT, WT = TAT – BT

 

 

 

HRRN process schedule not only as per shortest job also see another criterion which process wait for a long time.