
Introduction
Nowadays, we all are surrounded by multiprogramming operating systems. These operating systems are fast and very efficient in handling so many processes at a single time without fail. If you do not understand multitasking or multiprogramming, pause and check out your mobile phone. Bingo! You just did multitasking 😂😂. At the same time, you checked your phone and read this blog.
Our brain is the smartest thing on the planet so we can perform multitasking without any scheduling algorithm, but operating systems need a set of rules or algorithms to decide which processes are to be executed and when.
This set of algorithms is called scheduling algorithms, and in this article, we will discuss one of the most optimal scheduling algorithms known as HRRN scheduling.
The highest response ratio next or the HRRN scheduling algorithm is a non-preemptive kind of algorithm, which runs on the dependency of the response ratio of a process. Let us discuss the response ratio in the next section.
Recommended Topic, FCFS Scheduling Algorithm, Multiprogramming vs Multitasking
Response ratio
As the name suggests, it must be a ratio of two things. The two things are the process's waiting time and the burst/execution time. We have a direct formula to determine the response ratio for a process.
Response ratio = (W+S)/S,
Where W is the waiting time of the process in the ready queue and S is the total time needed by the process to complete its execution.
The above formula shows that the process with a low burst time will have a higher response ratio, increasing the priority of the process to get executed by the CPU.
With every increment in the waiting time of the process, the response ratio will increase and thus making the process more probable to be completed as soon as the CPU is free.
With the above theory, we can derive the following conclusions in the context of response ratio.
- The response ratio is directly proportional to the waiting time of the process.
- The response ratio is inversely proportional to the burst/execution time of the process.
Let us understand in brief the working of this algorithm.