SlideShare a Scribd company logo
Round Robin Algorithm Scheduling Algorithm
RR Scheduling Example:
There are six processes named as P1, P2, P3, P4, P5 and P6. Their arrival time and burst time are given
below in the table. The time quantum of the system is 4 units. Calculate Average waiting time and
average turn around time.
Process ID Arrival Time Burst Time
1 0 5
2 1 6
3 2 3
4 3 1
5 4 5
6 6 4
Answer:
According to the algorithm, we have to maintain the ready queue and the Gantt chart. The structure of
both the data structures will be changed after every scheduling.
Ready Queue:
Initially, at time 0, process P1 arrives which will be scheduled for the time slice 4 units. Hence in the
ready queue, there will be only one process P1 at starting with CPU burst time 5 units.
P1
5
GANTT chart:
The P1 will be executed for 4 units first.
P1
0 4
Ready Queue
Meanwhile the execution of P1, four more processes P2, P3, P4 and P5 arrives in the ready
queue. P1 has not completed yet, it needs another 1 unit of time hence it will also be added
back to the ready queue.
Process P2 P3 P4 P5 P1
Burst Time 6 3 1 5 1
GANTT chart
After P1, P2 will be executed for 4 units of time which is shown in the Gantt chart.
P1 P2
0 4 8
Ready Queue
During the execution of P2, one more process P6 is arrived in the ready queue. Since P2 has
not completed yet hence, P2 will also be added back to the ready queue with the remaining
burst time 2 units.
P3 P4 P5 P1 P6 P2
3 1 5 1 4 2
GANTT chart
After P1 and P2, P3 will get executed for 3 units of time since its CPU burst time is only 3
seconds.
P1 P2 P3
0 4 8 12
Ready Queue
Since P3 has been completed, hence it will be terminated and not be added to the ready queue.
The next process will be executed is P4.
P4 P5 P1 P6 P2
1 5 1 4 2
GANTT chart
After, P1, P2 and P3, P4 will get executed. Its burst time is only 1 unit which is lesser then the
time quantum hence it will be completed.
P1 P2 P3 P4
0 4 8 11 12
Ready Queue
The next process in the ready queue is P5 with 5 units of burst time. Since P4 is completed
hence it will not be added back to the queue.
P5 P1 P6 P2
5 1 4 2
GANTT chart
P5 will be executed for the whole time slice because it requires 5 units of burst time which is
higher than the time slice.
P1 P2 P3 P4 P5
0 4 8 11 12 16
Ready Queue
P5 has not been completed yet; it will be added back to the queue with the remaining burst time
of 1 unit.
P1 P6 P2 P5
1 4 2 1
GANTT Chart
The process P1 will be given the next turn to complete its execution. Since it only requires 1
unit of burst time hence it will be completed.
P1 P2 P3 P4 P5 P1
0 4 8 11 12 16 17
Ready Queue
P1 is completed and will not be added back to the ready queue. The next process P6 requires
only 4 units of burst time and it will be executed next.
P6 P2 P5
4 2 1
GANTT chart
P6 will be executed for 4 units of time till completion.
P1 P2 P3 P4 P5 P1 P6
0 4 8 11 12 16 17 21
Ready Queue
Since P6 is completed, hence it will not be added again to the queue. There are only two
processes present in the ready queue. The Next process P2 requires only 2 units of time.
P2 P5
2 1
GANTT Chart
P2 will get executed again, since it only requires only 2 units of time hence this will be
completed.
P1 P2 P3 P4 P5 P1 P6 P2
0 4 8 11 12 16 17 21 23
Ready Queue
Now, the only available process in the queue is P5 which requires 1 unit of burst time. Since
the time slice is of 4 units hence it will be completed in the next burst.
P5
1
GANTT chart
P5 will get executed till completion.
P1 P2 P3 P4 P5 P1 P6 P2 P5
0 4 8 11 12 16 17 21 23 24
As, we know to calculate:
Turn Around Time = Completion Time - Arrival Time
Waiting Time = Turn Around Time - Burst Time
Process
ID
Arrival
Time
Burst
Time
Completion
Time
Turn Around
Time
(Completion Time –
Arrival Time)
Waiting
Time
(Turn Around Time –
Arrival Time)
1 0 5 17 17 12
2 1 6 23 22 16
3 2 3 11 9 6
4 3 1 12 9 8
5 4 5 24 20 15
6 6 4 21 15 11
Avg Waiting Time = ∑
=(12+16+6+8+15+11)/6
=68/6
= 11.33 ms
Avg Turn Around Time = ∑
=(17+22+9+9+20+15)/6
=92/6
= 15.33 ms
Turn Around time of All Process
Waiting Time of All Process
No of Process
No of Process

More Related Content

What's hot

Scheduling algorithms
Scheduling algorithmsScheduling algorithms
Scheduling algorithms
Chankey Pathak
 
CPU Scheduling Algorithm (SJF, Round-Robin, Priority)
CPU Scheduling Algorithm (SJF, Round-Robin, Priority)CPU Scheduling Algorithm (SJF, Round-Robin, Priority)
CPU Scheduling Algorithm (SJF, Round-Robin, Priority)
Solaiman Hridoy
 
Concurrency Control Techniques
Concurrency Control TechniquesConcurrency Control Techniques
Concurrency Control Techniques
Raj vardhan
 
Cpu scheduling
Cpu schedulingCpu scheduling
Cpu scheduling
Abhijith Reloaded
 
Deadlock in Operating System
Deadlock in Operating SystemDeadlock in Operating System
Deadlock in Operating System
AUST
 
Cs8493 unit 5
Cs8493 unit 5Cs8493 unit 5
Cs8493 unit 5
Kathirvel Ayyaswamy
 
cpu scheduling.pdf
cpu scheduling.pdfcpu scheduling.pdf
cpu scheduling.pdf
MuralidharaV3
 
Sql server ___________session_17(indexes)
Sql server  ___________session_17(indexes)Sql server  ___________session_17(indexes)
Sql server ___________session_17(indexes)
Ehtisham Ali
 
Bankers algorithm
Bankers algorithmBankers algorithm
Bankers algorithm
AAQIB PARREY
 
Disk allocation methods
Disk allocation methodsDisk allocation methods
Disk allocation methods
ajeela mushtaq
 
14 query processing-sorting
14 query processing-sorting14 query processing-sorting
14 query processing-sorting
rameswara reddy venkat
 
Threads (operating System)
Threads (operating System)Threads (operating System)
Threads (operating System)
Prakhar Maurya
 
deadlock avoidance
deadlock avoidancedeadlock avoidance
deadlock avoidance
wahab13
 
Semophores and it's types
Semophores and it's typesSemophores and it's types
Semophores and it's types
Nishant Joshi
 
Multithreading
MultithreadingMultithreading
Multithreading
A B Shinde
 
Data structure tries
Data structure triesData structure tries
Data structure tries
Md. Naim khan
 
THREADS of Operating System by Noman Zahid
THREADS of Operating System by Noman Zahid THREADS of Operating System by Noman Zahid
THREADS of Operating System by Noman Zahid
noman zahid
 
Chapter 11 - File System Implementation
Chapter 11 - File System ImplementationChapter 11 - File System Implementation
Chapter 11 - File System Implementation
Wayne Jones Jnr
 
OS - Deadlock
OS - DeadlockOS - Deadlock
OS - Deadlock
vinay arora
 
Java And Multithreading
Java And MultithreadingJava And Multithreading
Java And Multithreading
Shraddha
 

What's hot (20)

Scheduling algorithms
Scheduling algorithmsScheduling algorithms
Scheduling algorithms
 
CPU Scheduling Algorithm (SJF, Round-Robin, Priority)
CPU Scheduling Algorithm (SJF, Round-Robin, Priority)CPU Scheduling Algorithm (SJF, Round-Robin, Priority)
CPU Scheduling Algorithm (SJF, Round-Robin, Priority)
 
Concurrency Control Techniques
Concurrency Control TechniquesConcurrency Control Techniques
Concurrency Control Techniques
 
Cpu scheduling
Cpu schedulingCpu scheduling
Cpu scheduling
 
Deadlock in Operating System
Deadlock in Operating SystemDeadlock in Operating System
Deadlock in Operating System
 
Cs8493 unit 5
Cs8493 unit 5Cs8493 unit 5
Cs8493 unit 5
 
cpu scheduling.pdf
cpu scheduling.pdfcpu scheduling.pdf
cpu scheduling.pdf
 
Sql server ___________session_17(indexes)
Sql server  ___________session_17(indexes)Sql server  ___________session_17(indexes)
Sql server ___________session_17(indexes)
 
Bankers algorithm
Bankers algorithmBankers algorithm
Bankers algorithm
 
Disk allocation methods
Disk allocation methodsDisk allocation methods
Disk allocation methods
 
14 query processing-sorting
14 query processing-sorting14 query processing-sorting
14 query processing-sorting
 
Threads (operating System)
Threads (operating System)Threads (operating System)
Threads (operating System)
 
deadlock avoidance
deadlock avoidancedeadlock avoidance
deadlock avoidance
 
Semophores and it's types
Semophores and it's typesSemophores and it's types
Semophores and it's types
 
Multithreading
MultithreadingMultithreading
Multithreading
 
Data structure tries
Data structure triesData structure tries
Data structure tries
 
THREADS of Operating System by Noman Zahid
THREADS of Operating System by Noman Zahid THREADS of Operating System by Noman Zahid
THREADS of Operating System by Noman Zahid
 
Chapter 11 - File System Implementation
Chapter 11 - File System ImplementationChapter 11 - File System Implementation
Chapter 11 - File System Implementation
 
OS - Deadlock
OS - DeadlockOS - Deadlock
OS - Deadlock
 
Java And Multithreading
Java And MultithreadingJava And Multithreading
Java And Multithreading
 

Similar to Round Robin Algorithm.pdf

First Come First Serve (FCFS).pptx
First Come First Serve (FCFS).pptxFirst Come First Serve (FCFS).pptx
First Come First Serve (FCFS).pptx
Bangladesh Army University of Engineering & Technology
 
scheduling-algorithms.pdf
scheduling-algorithms.pdfscheduling-algorithms.pdf
scheduling-algorithms.pdf
DeepakM509554
 
scheduling-algorithms.ppt
scheduling-algorithms.pptscheduling-algorithms.ppt
scheduling-algorithms.ppt
KIRANJOSE23
 
Operating System - FCFS and Priority Scheduling Algorithm and Code
Operating System - FCFS and Priority Scheduling Algorithm and Code Operating System - FCFS and Priority Scheduling Algorithm and Code
Operating System - FCFS and Priority Scheduling Algorithm and Code
Tamir Azrab
 
Program for FCFS CPU Scheduling.program docx
Program for FCFS CPU Scheduling.program docxProgram for FCFS CPU Scheduling.program docx
Program for FCFS CPU Scheduling.program docx
AbdulraufKhan29
 
Operating system
Operating systemOperating system
Operating system
raeesa khan
 
OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...
Dr. Mazin Mohamed alkathiri
 
International Journal of Engineering Research and Development (IJERD)
International Journal of Engineering Research and Development (IJERD)International Journal of Engineering Research and Development (IJERD)
International Journal of Engineering Research and Development (IJERD)
IJERD Editor
 
Operating system
Operating systemOperating system
Operating system
Lovly Angel
 
Cs problem [repaired]
Cs problem [repaired]Cs problem [repaired]
Cs problem [repaired]
Pradeep Kumar TS
 
Fcfs and sjf
Fcfs and sjfFcfs and sjf
Fcfs and sjf
A. S. M. Shafi
 
OS Process Chapter 3.pdf
OS Process Chapter 3.pdfOS Process Chapter 3.pdf
OS Process Chapter 3.pdf
Kp Sharma
 
Comparison Analysis of CPU Scheduling : FCFS, SJF and Round Robin
Comparison Analysis of CPU Scheduling : FCFS, SJF and Round RobinComparison Analysis of CPU Scheduling : FCFS, SJF and Round Robin
Comparison Analysis of CPU Scheduling : FCFS, SJF and Round Robin
Universitas Pembangunan Panca Budi
 
OS_Ch6
OS_Ch6OS_Ch6
OSCh6
OSCh6OSCh6
RR and priority scheduling
RR and priority schedulingRR and priority scheduling
RR and priority scheduling
A. S. M. Shafi
 
Ch5
Ch5Ch5
Operating Systems - CPU Scheduling Process
Operating Systems - CPU Scheduling ProcessOperating Systems - CPU Scheduling Process
Operating Systems - CPU Scheduling Process
Chandrakant Divate
 
Cpu Scheduling Galvin
Cpu Scheduling GalvinCpu Scheduling Galvin
Cpu Scheduling Galvin
Sonali Chauhan
 
CH06.pdf
CH06.pdfCH06.pdf
CH06.pdf
ImranKhan880955
 

Similar to Round Robin Algorithm.pdf (20)

First Come First Serve (FCFS).pptx
First Come First Serve (FCFS).pptxFirst Come First Serve (FCFS).pptx
First Come First Serve (FCFS).pptx
 
scheduling-algorithms.pdf
scheduling-algorithms.pdfscheduling-algorithms.pdf
scheduling-algorithms.pdf
 
scheduling-algorithms.ppt
scheduling-algorithms.pptscheduling-algorithms.ppt
scheduling-algorithms.ppt
 
Operating System - FCFS and Priority Scheduling Algorithm and Code
Operating System - FCFS and Priority Scheduling Algorithm and Code Operating System - FCFS and Priority Scheduling Algorithm and Code
Operating System - FCFS and Priority Scheduling Algorithm and Code
 
Program for FCFS CPU Scheduling.program docx
Program for FCFS CPU Scheduling.program docxProgram for FCFS CPU Scheduling.program docx
Program for FCFS CPU Scheduling.program docx
 
Operating system
Operating systemOperating system
Operating system
 
OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...
 
International Journal of Engineering Research and Development (IJERD)
International Journal of Engineering Research and Development (IJERD)International Journal of Engineering Research and Development (IJERD)
International Journal of Engineering Research and Development (IJERD)
 
Operating system
Operating systemOperating system
Operating system
 
Cs problem [repaired]
Cs problem [repaired]Cs problem [repaired]
Cs problem [repaired]
 
Fcfs and sjf
Fcfs and sjfFcfs and sjf
Fcfs and sjf
 
OS Process Chapter 3.pdf
OS Process Chapter 3.pdfOS Process Chapter 3.pdf
OS Process Chapter 3.pdf
 
Comparison Analysis of CPU Scheduling : FCFS, SJF and Round Robin
Comparison Analysis of CPU Scheduling : FCFS, SJF and Round RobinComparison Analysis of CPU Scheduling : FCFS, SJF and Round Robin
Comparison Analysis of CPU Scheduling : FCFS, SJF and Round Robin
 
OS_Ch6
OS_Ch6OS_Ch6
OS_Ch6
 
OSCh6
OSCh6OSCh6
OSCh6
 
RR and priority scheduling
RR and priority schedulingRR and priority scheduling
RR and priority scheduling
 
Ch5
Ch5Ch5
Ch5
 
Operating Systems - CPU Scheduling Process
Operating Systems - CPU Scheduling ProcessOperating Systems - CPU Scheduling Process
Operating Systems - CPU Scheduling Process
 
Cpu Scheduling Galvin
Cpu Scheduling GalvinCpu Scheduling Galvin
Cpu Scheduling Galvin
 
CH06.pdf
CH06.pdfCH06.pdf
CH06.pdf
 

Recently uploaded

Unit-III-ELECTROCHEMICAL STORAGE DEVICES.ppt
Unit-III-ELECTROCHEMICAL STORAGE DEVICES.pptUnit-III-ELECTROCHEMICAL STORAGE DEVICES.ppt
Unit-III-ELECTROCHEMICAL STORAGE DEVICES.ppt
KrishnaveniKrishnara1
 
Data Control Language.pptx Data Control Language.pptx
Data Control Language.pptx Data Control Language.pptxData Control Language.pptx Data Control Language.pptx
Data Control Language.pptx Data Control Language.pptx
ramrag33
 
An Introduction to the Compiler Designss
An Introduction to the Compiler DesignssAn Introduction to the Compiler Designss
An Introduction to the Compiler Designss
ElakkiaU
 
Computational Engineering IITH Presentation
Computational Engineering IITH PresentationComputational Engineering IITH Presentation
Computational Engineering IITH Presentation
co23btech11018
 
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
IJECEIAES
 
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
171ticu
 
cnn.pptx Convolutional neural network used for image classication
cnn.pptx Convolutional neural network used for image classicationcnn.pptx Convolutional neural network used for image classication
cnn.pptx Convolutional neural network used for image classication
SakkaravarthiShanmug
 
Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...
IJECEIAES
 
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
IJECEIAES
 
BRAIN TUMOR DETECTION for seminar ppt.pdf
BRAIN TUMOR DETECTION for seminar ppt.pdfBRAIN TUMOR DETECTION for seminar ppt.pdf
BRAIN TUMOR DETECTION for seminar ppt.pdf
LAXMAREDDY22
 
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student MemberIEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
VICTOR MAESTRE RAMIREZ
 
Software Quality Assurance-se412-v11.ppt
Software Quality Assurance-se412-v11.pptSoftware Quality Assurance-se412-v11.ppt
Software Quality Assurance-se412-v11.ppt
TaghreedAltamimi
 
Null Bangalore | Pentesters Approach to AWS IAM
Null Bangalore | Pentesters Approach to AWS IAMNull Bangalore | Pentesters Approach to AWS IAM
Null Bangalore | Pentesters Approach to AWS IAM
Divyanshu
 
Mechanical Engineering on AAI Summer Training Report-003.pdf
Mechanical Engineering on AAI Summer Training Report-003.pdfMechanical Engineering on AAI Summer Training Report-003.pdf
Mechanical Engineering on AAI Summer Training Report-003.pdf
21UME003TUSHARDEB
 
AI assisted telemedicine KIOSK for Rural India.pptx
AI assisted telemedicine KIOSK for Rural India.pptxAI assisted telemedicine KIOSK for Rural India.pptx
AI assisted telemedicine KIOSK for Rural India.pptx
architagupta876
 
LLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by Anant
LLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by AnantLLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by Anant
LLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by Anant
Anant Corporation
 
Comparative analysis between traditional aquaponics and reconstructed aquapon...
Comparative analysis between traditional aquaponics and reconstructed aquapon...Comparative analysis between traditional aquaponics and reconstructed aquapon...
Comparative analysis between traditional aquaponics and reconstructed aquapon...
bijceesjournal
 
Certificates - Mahmoud Mohamed Moursi Ahmed
Certificates - Mahmoud Mohamed Moursi AhmedCertificates - Mahmoud Mohamed Moursi Ahmed
Certificates - Mahmoud Mohamed Moursi Ahmed
Mahmoud Morsy
 
Material for memory and display system h
Material for memory and display system hMaterial for memory and display system h
Material for memory and display system h
gowrishankartb2005
 
An improved modulation technique suitable for a three level flying capacitor ...
An improved modulation technique suitable for a three level flying capacitor ...An improved modulation technique suitable for a three level flying capacitor ...
An improved modulation technique suitable for a three level flying capacitor ...
IJECEIAES
 

Recently uploaded (20)

Unit-III-ELECTROCHEMICAL STORAGE DEVICES.ppt
Unit-III-ELECTROCHEMICAL STORAGE DEVICES.pptUnit-III-ELECTROCHEMICAL STORAGE DEVICES.ppt
Unit-III-ELECTROCHEMICAL STORAGE DEVICES.ppt
 
Data Control Language.pptx Data Control Language.pptx
Data Control Language.pptx Data Control Language.pptxData Control Language.pptx Data Control Language.pptx
Data Control Language.pptx Data Control Language.pptx
 
An Introduction to the Compiler Designss
An Introduction to the Compiler DesignssAn Introduction to the Compiler Designss
An Introduction to the Compiler Designss
 
Computational Engineering IITH Presentation
Computational Engineering IITH PresentationComputational Engineering IITH Presentation
Computational Engineering IITH Presentation
 
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
 
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
 
cnn.pptx Convolutional neural network used for image classication
cnn.pptx Convolutional neural network used for image classicationcnn.pptx Convolutional neural network used for image classication
cnn.pptx Convolutional neural network used for image classication
 
Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...
 
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
 
BRAIN TUMOR DETECTION for seminar ppt.pdf
BRAIN TUMOR DETECTION for seminar ppt.pdfBRAIN TUMOR DETECTION for seminar ppt.pdf
BRAIN TUMOR DETECTION for seminar ppt.pdf
 
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student MemberIEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
 
Software Quality Assurance-se412-v11.ppt
Software Quality Assurance-se412-v11.pptSoftware Quality Assurance-se412-v11.ppt
Software Quality Assurance-se412-v11.ppt
 
Null Bangalore | Pentesters Approach to AWS IAM
Null Bangalore | Pentesters Approach to AWS IAMNull Bangalore | Pentesters Approach to AWS IAM
Null Bangalore | Pentesters Approach to AWS IAM
 
Mechanical Engineering on AAI Summer Training Report-003.pdf
Mechanical Engineering on AAI Summer Training Report-003.pdfMechanical Engineering on AAI Summer Training Report-003.pdf
Mechanical Engineering on AAI Summer Training Report-003.pdf
 
AI assisted telemedicine KIOSK for Rural India.pptx
AI assisted telemedicine KIOSK for Rural India.pptxAI assisted telemedicine KIOSK for Rural India.pptx
AI assisted telemedicine KIOSK for Rural India.pptx
 
LLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by Anant
LLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by AnantLLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by Anant
LLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by Anant
 
Comparative analysis between traditional aquaponics and reconstructed aquapon...
Comparative analysis between traditional aquaponics and reconstructed aquapon...Comparative analysis between traditional aquaponics and reconstructed aquapon...
Comparative analysis between traditional aquaponics and reconstructed aquapon...
 
Certificates - Mahmoud Mohamed Moursi Ahmed
Certificates - Mahmoud Mohamed Moursi AhmedCertificates - Mahmoud Mohamed Moursi Ahmed
Certificates - Mahmoud Mohamed Moursi Ahmed
 
Material for memory and display system h
Material for memory and display system hMaterial for memory and display system h
Material for memory and display system h
 
An improved modulation technique suitable for a three level flying capacitor ...
An improved modulation technique suitable for a three level flying capacitor ...An improved modulation technique suitable for a three level flying capacitor ...
An improved modulation technique suitable for a three level flying capacitor ...
 

Round Robin Algorithm.pdf

  • 1. Round Robin Algorithm Scheduling Algorithm RR Scheduling Example: There are six processes named as P1, P2, P3, P4, P5 and P6. Their arrival time and burst time are given below in the table. The time quantum of the system is 4 units. Calculate Average waiting time and average turn around time. Process ID Arrival Time Burst Time 1 0 5 2 1 6 3 2 3 4 3 1 5 4 5 6 6 4 Answer: According to the algorithm, we have to maintain the ready queue and the Gantt chart. The structure of both the data structures will be changed after every scheduling. Ready Queue: Initially, at time 0, process P1 arrives which will be scheduled for the time slice 4 units. Hence in the ready queue, there will be only one process P1 at starting with CPU burst time 5 units. P1 5 GANTT chart: The P1 will be executed for 4 units first. P1 0 4 Ready Queue Meanwhile the execution of P1, four more processes P2, P3, P4 and P5 arrives in the ready queue. P1 has not completed yet, it needs another 1 unit of time hence it will also be added back to the ready queue.
  • 2. Process P2 P3 P4 P5 P1 Burst Time 6 3 1 5 1 GANTT chart After P1, P2 will be executed for 4 units of time which is shown in the Gantt chart. P1 P2 0 4 8 Ready Queue During the execution of P2, one more process P6 is arrived in the ready queue. Since P2 has not completed yet hence, P2 will also be added back to the ready queue with the remaining burst time 2 units. P3 P4 P5 P1 P6 P2 3 1 5 1 4 2 GANTT chart After P1 and P2, P3 will get executed for 3 units of time since its CPU burst time is only 3 seconds. P1 P2 P3 0 4 8 12 Ready Queue Since P3 has been completed, hence it will be terminated and not be added to the ready queue. The next process will be executed is P4. P4 P5 P1 P6 P2 1 5 1 4 2 GANTT chart After, P1, P2 and P3, P4 will get executed. Its burst time is only 1 unit which is lesser then the time quantum hence it will be completed.
  • 3. P1 P2 P3 P4 0 4 8 11 12 Ready Queue The next process in the ready queue is P5 with 5 units of burst time. Since P4 is completed hence it will not be added back to the queue. P5 P1 P6 P2 5 1 4 2 GANTT chart P5 will be executed for the whole time slice because it requires 5 units of burst time which is higher than the time slice. P1 P2 P3 P4 P5 0 4 8 11 12 16 Ready Queue P5 has not been completed yet; it will be added back to the queue with the remaining burst time of 1 unit. P1 P6 P2 P5 1 4 2 1 GANTT Chart The process P1 will be given the next turn to complete its execution. Since it only requires 1 unit of burst time hence it will be completed. P1 P2 P3 P4 P5 P1 0 4 8 11 12 16 17 Ready Queue P1 is completed and will not be added back to the ready queue. The next process P6 requires only 4 units of burst time and it will be executed next.
  • 4. P6 P2 P5 4 2 1 GANTT chart P6 will be executed for 4 units of time till completion. P1 P2 P3 P4 P5 P1 P6 0 4 8 11 12 16 17 21 Ready Queue Since P6 is completed, hence it will not be added again to the queue. There are only two processes present in the ready queue. The Next process P2 requires only 2 units of time. P2 P5 2 1 GANTT Chart P2 will get executed again, since it only requires only 2 units of time hence this will be completed. P1 P2 P3 P4 P5 P1 P6 P2 0 4 8 11 12 16 17 21 23 Ready Queue Now, the only available process in the queue is P5 which requires 1 unit of burst time. Since the time slice is of 4 units hence it will be completed in the next burst. P5 1 GANTT chart P5 will get executed till completion. P1 P2 P3 P4 P5 P1 P6 P2 P5 0 4 8 11 12 16 17 21 23 24
  • 5. As, we know to calculate: Turn Around Time = Completion Time - Arrival Time Waiting Time = Turn Around Time - Burst Time Process ID Arrival Time Burst Time Completion Time Turn Around Time (Completion Time – Arrival Time) Waiting Time (Turn Around Time – Arrival Time) 1 0 5 17 17 12 2 1 6 23 22 16 3 2 3 11 9 6 4 3 1 12 9 8 5 4 5 24 20 15 6 6 4 21 15 11 Avg Waiting Time = ∑ =(12+16+6+8+15+11)/6 =68/6 = 11.33 ms Avg Turn Around Time = ∑ =(17+22+9+9+20+15)/6 =92/6 = 15.33 ms Turn Around time of All Process Waiting Time of All Process No of Process No of Process