Skip to main content

Round Robin

  

Round Robin

·         Round robin Scheduling is similar to FCFS but preemption is addede to switch between processes.

·         In RR scheduling, processes are dispatched in FIFO but given a small amount of CPU time. This small amount of CPU time this small amount of time is known as time quantum or time slice. A time quantum is generally from 10 to 100 milliseconds

·         If a process does not complete before its time slice expires, the CPU is time slice and is given to the next waiting process in ready queue.

·         The preempted process in then places at the  tail of the ready queue.

·         If a process is completed before its time slice expires, the process itself release the CPU. The scheduler then proceeds to the next process in ready queue.

·         Whenever any new process arrives in the system it is added at the tail of the ready queue.

·         Round robin scheduling is effective in timesharing environment in which the system need to guarantee reasonable response time for interactive users.

·         The performance of round robin scheduling algorithm depends upon severalfactors these are:-

1. Size Of Time Quantum Or Slice

·         If the size of time is considerably larger then this algorithm becomes same as FCFS algorithm and thus performance degrades.

·         If the size of time slice is very small than the number of context switches increses and CPU will be busy in switches itself from one process to another rather than performing calculations

·         Thus, the time quantum should not be very and also should not be too small to achieve good system performance

2. Context Switches Overhead

·         Context switches is performed frequently in round robin scheduling as compared to FCFS or SJF scheduling

·         Context switch in round robimn scheduling should be planned in such as way that it takes very less time.

·         In other words, the ratio between the context switching time and the calculation or execution time should be low.


Example of Round-robin Scheduling

Consider this following three processes

Process QueueBurst time
P14
P23
P35

Step 1) The execution begins with process P1, which has burst time 4. Here, every process executes for 2 seconds. P2 and P3 are still in the waiting queue.

Step 2) At time =2, P1 is added to the end of the Queue and P2 starts executing

Step 3) At time=4 , P2 is preempted and add at the end of the queue. P3 starts executing.

Step 4) At time=6 , P3 is preempted and add at the end of the queue. P1 starts executing.

Step 5) At time=8 , P1 has a burst time of 4. It has completed execution. P2 starts execution

Step 6) P2 has a burst time of 3. It has already executed for 2 interval. At time=9, P2 completes execution. Then, P3 starts execution till it completes.

Step 7) Let's calculate the average waiting time for above example.

Wait time 
P1= 0+ 4= 4
P2= 2+4= 6
P3= 4+3= 7

Advantage of Round-robin Scheduling

Here, are pros/benefits of Round-robin scheduling method:

  • It doesn't face the issues of starvation or convoy effect.
  • All the jobs get a fair allocation of CPU.
  • It deals with all process without any priority
  • If you know the total number of processes on the run queue, then you can also assume the worst-case response time for the same process.
  • This scheduling method does not depend upon burst time. That's why it is easily implementable on the system.
  • Once a process is executed for a specific set of the period, the process is preempted, and another process executes for that given time period.
  • Allows OS to use the Context switching method to save states of preempted processes.
  • It gives the best performance in terms of average response time.

Disadvantages of Round-robin Scheduling

Here, are drawbacks/cons of using Round-robin scheduling:

  • If slicing time of OS is low, the processor output will be reduced.
  • This method spends more time on context switching
  • Its performance heavily depends on time quantum.
  • Priorities cannot be set for the processes.
  • Round-robin scheduling doesn't give special priority to more important tasks.
  • Decreases comprehension
  • Lower time quantum results in higher the context switching overhead in the system.
  • Finding a correct time quantum is a quite difficult task in this system.

 

Comments

Popular posts from this blog

Classification of Operating System

  Classification of operating systems The operating systems may be classified into different types depending upon the nature of interaction between the user and his/her program. The various types of operating system are : 1.       single user operating system    2.        Multi user operating system   3.         Batch processing operating system 4.        Multi programming operating system   5.       Multi tasking operating system   6.         Multiprocessing operating system 7.         Time sharing operating system 8.       Real time system      Distributed system Multi threading operating system       Single user operating system ·          ...

Micro kernel architecture

  Micro kernel  architecture What is Kernel? A kernel is an important part of an OS that manages system resources. It also acts as a bridge between the software and hardware of the computer. It is one of the first program which is loaded on start-up after the bootloader. The Kernel is also responsible for offering secure access to the machine's hardware for various programs. It also decides when and how long a certain application uses specific hardware. What is Microkernel? Microkernel  is a software or code which contains the required minimum amount of functions, data, and features to implement an operating system. It provides a minimal number of mechanisms, which is good enough to run the most basic functions of an operating system. It allows other parts of the operating system to be implemented as it does not impose a lot of policies. Microkernels and their user environments are usually implemented in the C++ or C programming languages with a little bit of assembly. Ho...

Multi Programming Operating System

  Multi programming  system ·           Multi programming operating system allows multiple users to execute multiple programs using a single CPU concurrently i.e. at the same time. ·           In multiprogramming several process are kept in the main memory and CPU execute all these processes concurrently. It means, the CPU immediately switches from one process to next that are ready to get executed ·           In such an operating system when one process start process start performing the instructions from several programs at the same time. ·           Rather, it means that there are number program available to CPU and that portion of one is executed, then segment of another and so on                                 ...

Easytolearn E-book 2

                                                                                                                                                                          Description:here we give you pdf. about classification of operating system in which  we provide all information of classification in detail.  

ENTERPROCESS COMMUNICATION AND SYNCHRONIZATION

      ENTERPROCESS COMMUNICATION AND SYNCHRONIZATION ·          In multi programming environment multiple process co-exit . a single   program may be broken into number of processes. ·          The process are classified into two categories : independent processes and cooperating processes. ·          An independent process is a standalone process that does not share any data with any other process. It cannot affect or be affected by the other processes executing   in the system. In other words, the modification made to an independent process does not affect the functioning of other process. ·          A cooperating processes is a process that shares data with other processes in a system it can affect or be affectedly the other processes executing in the system ·      ...