×

HRRN Scheduling in OS

Highest Response Ratio Next (HRRN) Scheduling in OS

Highest Response Ratio Next Scheduling is a Non-Preemptive Scheduling algorithm. This algorithm provides the benefits of the shortest job first scheduling algorithm and also removes the limits of the shortest job first scheduling algorithm.

It is one of the most optimal scheduling algorithms among all other scheduling algorithms. In Highest Response Ratio, scheduling of the jobs is implemented on the basis of an additional parameter, which is called Response Ratio. We calculate the response ratio for every available process, and the process, which has the highest response ratio holds the highest priority among all the processes.

Response Ratio is calculated with the help of given formula:

          Response Ratio = (W+S)/S

Where,

         W is a Waiting Time

          S is a Service Time or Burst Time

In the following example, we have 5 processes with process ID P1, P2, P3, P4, and P5. The arrival time and burst time of the processes are given in the following table.

      Process ID    Arrival Time     Burst Time
              P1             0                 3
              P2             2                 7
              P3             4                 5
              P4             6                 2
              P5              8                 4

Gantt Chart

HRRN Scheduling in OS

Explanation

  • Initially, at time=0, the process P1 was in the ready queue. So, the process P1 completes its execution.
  • After the process P1, at time=3, only the process P2 arrived, so the process P2 executed because the operating system did not had any other option.
  • At time=10, the processes P3, P4, and P5 were in ready queue. So, to schedule the next process after P2, we had calculated the response ratio.
  • Next we calculated the response ratio for P3, P4, and P5.

Response Ratio = W+S/S

  RR(P3) = [(10-4) +5]/5

               = 2.2    

  RR(P4) = [(10-6) +2]/2

                = 3

  RR(P5) = [(10-8) +4]/4

               = 1.5

As it is clear that the Process P4 has the Highest Response ratio, so the Process P4 was scheduled after P2.

  • Then, we had two processes i.e., P3 and P5, which are in the ready queue.

         So, we again calculate the Response Ratio for the Process P3 and P5.

          RR (P3) = [(12-6) +2]/2

                      =4

          RR (P5) = [(12-8) +4]/4

                        =2 

       Process P3 has the Highest Response Ratio so, next Process P3 was executed.

  • After the Process P3 completed its execution, the Process P5 was only left in the ready queue. So, the Process P3 was executed next.      

The waiting Time and Turnaround Time were calculated with the help of the following formula.

         Waiting Time = Turnaround time – Burst Time

          Turnaround Time = Completion time – Arrival time 

   Process ID   Arriving Time          Burst Time  Completion Time Turnaround Time Waiting Time
          P1            0           3               3            3         0
          P2            2          7               10            8         1
          P3            4          5               17           13         8
          P4            6          2               12             6          4
          P5            8           4                21              13           9

Average Waiting Time= 0+1+8+4+9/5

                                       = 4.4

Average Turnaround Time = 3+8+13+6+13/5

                                               = 8.6

Advantages of Highest Response Ratio Next Scheduling

The advantages of Highest Response Ratio Next Scheduling are:

  1. The Performance of HRRN Scheduling is better than the shortest job first Scheduling.
  2.  HRRN Scheduling reduces the longer job waiting time and also encourages shorter jobs.
  3. Increase throughput.

Disadvantage of Highest Response Ratio Next Scheduling

The disadvantages of Highest Response Ration Next Scheduling are:

  1. Practical implementation is not possible in HRRN Scheduling because we cannot know the burst time of every process in advance.
  2. In HRRN Scheduling, overhead on processors may occur.

Related Topics

N-Step-SCAN Disk Scheduling

Before you study about N-Step-SCAN Disk Scheduling, it requires prerequisite of what is Disk Scheduling Algorithms: Operating systems use disc scheduling to schedule I/O requests that arrive at the disc....

4 minutes read.

Batch Operating System

Computers were once quite huge devices that operated from a console. Tape drives, punch cards, line printers were often utilized for the output, and tape drivers or card readers for...

4 minutes read.

File Allocation Methods in Operating System

A file allocation method is a way that an operating system stores and retrieves files on a storage device, such as a hard drive or SSD. The file allocation method...

4 minutes read.

What is Deadlock in OS?

Deadlock in Operating System In an Operating System, a process uses various resources, and the resources are used in the following manner: Request the ResourceUse the ResourceRelease the Resource In the Operating System, Deadlock is a condition...

4 minutes read.

Contiguous Memory Allocation in Operating System

Memory is a place where data, facts, figures, and information are stored for temporary or permanent access the data in future, which is also considered as the storage place. Allocation of...

4 minutes read.

Ubuntu Operating System

Ubuntu Operating System Ubuntu is an open-source and a Linux based operating system. Ubuntu is developed for the Network Servers, Computers, and Smartphones. The Ubuntu operating system was developed by Canonical...

3 minutes read.

Free Space Management in Operating System

What is Free Space Management? The system always keeps the records of the free disks blocks for allocating space to files when they are created. To use the space free from...

4 minutes read.

Look Disk Scheduling

Look Disk Scheduling Look disk scheduling is another type of disk scheduling algorithm. Look scheduling is an enhanced version of SCAN disk scheduling. Look disk scheduling is the same as SCAN disk scheduling,...

4 minutes read.

Difference between SSTF and LOOK Disk Scheduling Algorithm

Shortest Seek Time First / SSTF Shortest Seek Time First (SSTF) is an acronym for "shortest seek time first." The task request that is closest to the present position of the...

4 minutes read.

Directory Structure in Operating System

Directory Structure in Operating System What is a Directory A Directory is the collection of the correlated files on the disk. In simple words, a directory is like a container which contains...

8 minutes read.

Banker’s Algorithm in Operating System

What is Banker’s Algorithm? Bankers algorithm is an algorithm which is used for deadlock avoidance and resource allocation. It was established by Edsger Dijkstra. The reason behind the name ‘banker’s algorithm’...

8 minutes read.

File in Operating System

What is File in Operating System?  A file is defined as a collection of the interrelated information that is stored in the secondary memory or the non-volatile memory such as optical...

4 minutes read.

Multitasking Operating Systems

An operating system is the fundamental piece of software that enables a computer system to function and execute a command as intended. The user interface, hardware, and every other piece...

7 minutes read.

Evolution of Operating System

Evolution of Operating System The evolution of various types of operating systems can be briefly described as follows: Serial Processing Since 1950, the operating system started to be in use. Before 1950, there...

5 minutes read.

Paging and Segmentation in OS

What is Paging in OS? Paging is a storage technique used for memory management. In paging, the (OS) Operating System retrieves the processes from the secondary memory into the main memory,...

6 minutes read.

FCFS (First-Come-First-Serve) Disk Scheduling Algorithm

FCFS Disk Scheduling Algorithm FCFS (First-Come-First-Serve) is the easiest disk scheduling algorithm among all the scheduling algorithms. In the FCFS disk scheduling algorithm, each input/output request is served in the order...

4 minutes read.

Process State in OS

The Process passes from different states, from its formation to completion. The following are the states of the Process. NewReadyRunningBlock or WaitTerminated or CompletedSuspend readySuspend wait or suspend blocked 1. New: - The state in which a process...

2 minutes read.

Types of Operating System

There are various types of operating system: Simple Batch Operating SystemMultiprogramming batch Operating SystemTime-sharing Operating SystemMultiprocessor Operating SystemDistributed Operating SystemNetwork Operating SystemReal-time Operating SystemMobile Operating System Simple Batch operating system In the simple batch operating system, there is no direct communication between...

6 minutes read.

Unix Operating System

Unix Operating System Unix Operating System is a multiuser, portable, time-sharing, and multitasking operating system that was developed in 1969. Unix operating system was developed by a group of AT &...

3 minutes read.

Deadlock Prevention in Operating System

Deadlock Prevention The conditions which we used for deadlock prevention are: Mutual ExclusionHold and WaitNo PreemptionCircular Wait 1. Mutual Exclusion: - From the resource point of view, the mutual exclusion means that simultaneously more...

4 minutes read.