Operating Systems Laboratory
Department: CSE
Course Code: CSE 4510
Section: E
Trimester: Fall 2023
Members
Course Teacher : Gourab Saha
Md. Abdur Rahman 011202260
Shojib Talukder 011201345
Round Robin Scheduling
The Round-robin scheduling algorithm is a kind of
preemptive First come, First Serve CPU Scheduling
algorithm where each process in the ready state gets the
CPU for a fixed time in a cyclic way (turn by turn). It is the
oldest scheduling algorithm, which is mainly used for
multitasking.
How Does It Works?
❏ In the RR algorithm, a fixed time quantum is assigned to each process in the ready queue
❏ If the process completes its execution within the time quantum, it is removed from the queue
❏ If not, it is placed back in the queue, and the next process in the queue is given a chance to
execute. This process continues until all processes in the queue have executed.
Implementation
Process Arrival Time Burst Time
P0 0 3
P1 2 5
P2 3 1
TIME SLICE = 2
Process Arrival Time Burst Time
P0 0 3 1
P1 2 5
P2 3 1
Implementation
P0
0 2 4 5 6 8 9
Process Arrival Time Burst Time
P0 0 1
P1 2 5 3
P2 3 1
Implementation
P0 P1
0 2 4 5 6 8 9
Process Arrival Time Burst Time
P0 0 1
P1 2 3
P2 3 1 0
Implementation
P0 P1 P2
0 2 4 5 6 8 9
Process Arrival Time Burst Time
P0 0 1 0
P1 2 3
Implementation
P0 P1 P2 P0
0 2 4 5 6 8 9
Process Arrival Time Burst Time
P1 2 3 1
Implementation
P0 P1 P2 P0 P1
0 2 4 5 6 8 9
Process Arrival Time Burst Time
P1 2 1 0
Implementation
P0 P1 P2 P0 P1 P1
0 2 4 5 6 8 9
PERFORMANCE
❏ ResponseTimeAVG = 0.33
❏ WaitingTimeAVG = 2.33
❏ TurnAroundTime = 5.33
PERFORMANCE COMPARISON
Algorithms WaitingTimeavg ResponseTimeage
FCFS 2 2
SJF (preemptive) 0.66 0.66
SJF (non-preemptive) 0.66 0.66
RoundRobin 2.23 0.33
ADVANTAGE
❏ No starvation problem
❏ No convoy effect
❏ Fair allocation of CPU
❏ Best average response time *
DISADVANTAGE
❏ Not ideal where process priority are important
❏ Higher context switching overhead if sliced time is low
❏ Doesn’t have optimal average waiting time
❏ Difficult to find a correct time quantum
THANK YOU

RoundRobin _ OS_LAB.pptx

  • 1.
    Operating Systems Laboratory Department:CSE Course Code: CSE 4510 Section: E Trimester: Fall 2023 Members Course Teacher : Gourab Saha Md. Abdur Rahman 011202260 Shojib Talukder 011201345
  • 2.
    Round Robin Scheduling TheRound-robin scheduling algorithm is a kind of preemptive First come, First Serve CPU Scheduling algorithm where each process in the ready state gets the CPU for a fixed time in a cyclic way (turn by turn). It is the oldest scheduling algorithm, which is mainly used for multitasking.
  • 3.
    How Does ItWorks? ❏ In the RR algorithm, a fixed time quantum is assigned to each process in the ready queue ❏ If the process completes its execution within the time quantum, it is removed from the queue ❏ If not, it is placed back in the queue, and the next process in the queue is given a chance to execute. This process continues until all processes in the queue have executed.
  • 4.
    Implementation Process Arrival TimeBurst Time P0 0 3 P1 2 5 P2 3 1 TIME SLICE = 2
  • 5.
    Process Arrival TimeBurst Time P0 0 3 1 P1 2 5 P2 3 1 Implementation P0 0 2 4 5 6 8 9
  • 6.
    Process Arrival TimeBurst Time P0 0 1 P1 2 5 3 P2 3 1 Implementation P0 P1 0 2 4 5 6 8 9
  • 7.
    Process Arrival TimeBurst Time P0 0 1 P1 2 3 P2 3 1 0 Implementation P0 P1 P2 0 2 4 5 6 8 9
  • 8.
    Process Arrival TimeBurst Time P0 0 1 0 P1 2 3 Implementation P0 P1 P2 P0 0 2 4 5 6 8 9
  • 9.
    Process Arrival TimeBurst Time P1 2 3 1 Implementation P0 P1 P2 P0 P1 0 2 4 5 6 8 9
  • 10.
    Process Arrival TimeBurst Time P1 2 1 0 Implementation P0 P1 P2 P0 P1 P1 0 2 4 5 6 8 9
  • 11.
    PERFORMANCE ❏ ResponseTimeAVG =0.33 ❏ WaitingTimeAVG = 2.33 ❏ TurnAroundTime = 5.33
  • 12.
    PERFORMANCE COMPARISON Algorithms WaitingTimeavgResponseTimeage FCFS 2 2 SJF (preemptive) 0.66 0.66 SJF (non-preemptive) 0.66 0.66 RoundRobin 2.23 0.33
  • 13.
    ADVANTAGE ❏ No starvationproblem ❏ No convoy effect ❏ Fair allocation of CPU ❏ Best average response time *
  • 14.
    DISADVANTAGE ❏ Not idealwhere process priority are important ❏ Higher context switching overhead if sliced time is low ❏ Doesn’t have optimal average waiting time ❏ Difficult to find a correct time quantum
  • 15.