![]() |
VOOZH | about |
The Highest Response Ratio Next (HRRN) scheduling algorithm is a non-preemptive scheduling technique used in operating systems to manage the execution of processes. It is designed to improve upon simpler algorithms like First-Come-First-Serve (FCFS) and Shortest Job Next (SJN) by balancing both the waiting time and the burst time of processes.
The key idea behind HRRN is to calculate a response ratio for each process, which is a measure of how long a process has been waiting compared to the time it needs for execution. The formula for the response ratio is:
In HRRN, the process with the highest response ratio is selected for execution next. This approach gives priority to processes that have been waiting longer, but also considers the burst time, ensuring a fair balance between long-waiting and quick-execution processes.
HRRN aims to reduce both starvation (by giving priority to long-waiting processes) and the inefficiency of short-job priority (by balancing burst time with waiting time). It provides a more efficient and fair way of scheduling processes, making it suitable for systems where long and short tasks need to be managed together.
Below is the implementation of above approach:
Output:
PN AT BT WT TAT NTT
A 0 3 0 3 1
B 2 6 1 7 1.16667
C 4 4 5 9 2.25
E 8 2 5 7 3.5
D 6 5 9 14 2.8
Average waiting time: 4
Average Turn Around time:8