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

Multitasking System

  Multitasking system ·           Technically , multitasking is same as multi programming ·           In a multitasking operating system, s single user can execute multiple programs at the same time ·           We can also say, multitasking is the system capability to work on more than one job or process at the same time. ·           It means that whenever a job needs to perform I/O operation, the cpu can be used for execting some other job                                                        diagram of multi tasking     ·           There are two type of multitasking : 1.       ...

Monolithic Architecture

  Monolithic Architecture Monolith means composed all in one piece. The  Monolithic  application describes a single-tiered  software  application in which different components combined into a single program from a single platform. Components can be: Authorization — responsible for authorizing a user Presentation — responsible for handling HTTP requests and responding with either HTML or JSON/XML (for web services APIs). Business logic — the application’s business logic. Database layer — data access objects responsible for accessing the database. Application integration — integration with other services (e.g. via messaging or REST API). Or integration with any other Data sources. Notification module — responsible for sending email notifications whenever needed. Example for Monolithic Approach Consider an example of Ecommerce application, that authorizes customer, takes an order, check products inventory, authorize payment and ships ordered products. This applicat...

Change the priority of a process

  Change the priority of a process You can tell the computer that certain processes should have a higher priority than others, and so should be given a bigger share of the available computing time. This can make them run faster, but only in certain cases. You can also give a process a  lower  priority if you think it is taking up too much processing power. Go to the  Processes  tab and click on the process you want to have a different priority. Right-click the process, and use the  Change Priority  menu to assign the process a higher or lower priority. There is typically little need to change process priorities manually. The computer will usually do a good job of managing them itself. (The system for managing the priority of processes is called  nice .) Does higher priority make a process run faster? The computer shares its processing time between all of the running processes. This is normally shared intelligently, so programs that are doing more ...

Batch Processing Operating System

  Batch processing system ·           Batch processing is one of the oldest method    of running the programs ·           The computer in the past were very large in size and their I/O devices were very different from those that are used today. The job processing was not interactive as it is today. ·           The user did not interact directly with computer system.   ·           The process scheduling , memory management, file management and I/Omanagement functions are quite simple in batch processing system   1.         Process scheduling (i.e. allocation strategy for a processor is typically in order of their arrival i.e. first come first served(FCFS)basis.   2.         Memory management  is done by divi...
 C omparison between real time and time sharing operating system P rotection and s ecurity  • Protection refers to a mechanism for controlling the access of program s processes, or users to the resources defined by computer system. • The concept of protection came with the advent of multiprogramming where several processes compete for the use of CPU. • the purpose was to confine each users program to its assigned areaof memory so that the programs cannot interface and harm each other. • Protection in main memory is particularly important because of address translation. The purpose of protection is to allow concurrently running process to share the common physical address space. • Protection also ensure that only process that have gained proper authorization from the operating system can operate on memory segment , the CPU, files and other resources.