×

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

CPU Scheduling in OS

What is Scheduling? Scheduling is the process that is used to share the computing resources such as memory, processor time, and bandwidth to the different processes, data flows, threads, and applications that need...

5 minutes read.

Swapping in Operating System

Swapping in operating systems refers to temporarily transferring a program or process from main memory to a secondary storage device, such as a hard drive or solid-state drive when there...

4 minutes read.

Booting Process in Operating System

What is Booting? Booting is defined as the term which says that the process of loading the operating system into the memory. The process of booting begins when we switch on...

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.

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.

Virtual Memory in Operating System

What is Virtual Memory Virtual Memory is a storage scheme in which the users have an illusion that users have a significant amount of Main Memory. We can perform this by taking a...

3 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.

Two Phase Locking Protocol

What is two phase locking? Two-phase locking is a concurrency control method in a database and transaction processing system. It ensures that transactions are executed in a serializable manner by requiring...

4 minutes read.

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...

6 minutes read.

What is Demand Paging?

Demand Paging is defined as a process in which the pages are loaded into the memory (when the page fault occurs) or on-demand. It consists of the following steps: If there is...

4 minutes read.

Single-User Operating System

An operating system designed and intended to be used on a computer or device with a single user at a time is known as a single-user operating system. Devices like...

8 minutes read.

Turn Variable or Strict Alternative Approach

Turn Variable or Strict Alternative Approach Turn Variable Approach is used for process synchronization mechanism, which offers synchronization between two processes. Turn variable is implemented on user mode, and it is a software mechanism. We...

3 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.

Process Synchronization | Operating System

Process Synchronization Process Synchronization means managing the process in such a manner so that no two processes have access to share similar data and resources. We can use Process Synchronization in a Multi-Process System...

4 minutes read.

Commercial Mobile Operating Systems

Introduction to Commercial Mobile Operating Systems A computer program's common services are managed by an operating system (OS), which also handles computer hardware and software resources. The user can communicate with...

7 minutes read.

DOS Operating System

What is DOS Operating System? An operating system that runs from a hard disk drive is known as the DOS (Disk Operating System).In other words, DOS (Disk Operating System) is defined...

7 minutes read.

Simple Structure in Operating System

An operating system is a piece of software that lets the user applications talk to the hardware of the system. Because it is such a complicated structure, the operating system...

3 minutes read.

Scheduling Algorithms in OS

There are various types of scheduling algorithm which are used by the operating system to schedule the process on the processor. Objective of Scheduling Algorithms There are the following objectives of Scheduling Algorithms: Fare allocation...

2 minutes read.

Priority Scheduling in OS

Priority Scheduling is a type of CPU Scheduling algorithm which is used for process scheduling. In Priority Scheduling, we assign some priorities to each process. The process which has higher priority among all...

5 minutes read.

Process Schedulers and Process Queue in OS

Process Schedulers There are various types of Process Schedulers: Long Term SchedulerShort Term SchedulerMedium Term Scheduler                                            Long Term Scheduler: - Long term scheduler is also referred to as Job Scheduler. The task of the Long-term...

3 minutes read.