SlideShare a Scribd company logo
1 of 9
Click to edit Master title style
1
CPU
Scheduling
Algorithm
(SJF, Round-Robin, Priority)
- Non Preemptive
P r e s e n t e d B y
M e h e n a z T a h e r i n
S o l a i m a n H r i d o y
M d . E h s a n u l I s l a m K h a n
S a m i a A k t e r
P u s h p i t a D u t t a
I D : 1 7 0 1 0 1 1 4
I D : 1 7 0 1 0 1 1 5
I D : 1 7 0 1 0 1 1 6
I D : 1 7 0 1 0 1 1 7
I D : 1 7 0 1 0 1 1 8
Click to edit Master title style
2
Table of Contents
• Definitions …………………………………………………………………………….. 01
• Shortest Job First (SJF) – without arrival time …………………………..02
• Shortest Job First (SJF) – with arrival time ……………………………….03
• Priority – without arrival time …………………………………………………. 04
• Priority – with arrival time …………………………..…………………………..05
• Round-Robin – without arrival time …………….……………………………06
Click to edit Master title style
3
Definitions
• SJF : Shortest Job First scheduling works on the process with
the shortest burst time or duration first.
• Priority: In this scheduling, processes are scheduled
according to their priorities, i.e., highest priority process is
scheduled first. If priorities of two processes match, then
schedule according to arrival time.
• Round –Robin: A fixed time is allotted to each process,
called quantum, for execution. Once a process is executed for given
time period that process is preempted and other process executes for
given time period.
01
Click to edit Master title style
4
Shortest Job First(SJF)
without arrival time – Non Preemptive
Process Burst Time
P1 21
P2 3
P3 6
P4 2
P4 P2 P3 P1
TABLE
Gantt
Chart
0 2 5 11 32
Waiting Time, P1 = 11, P2 = 2, P3 = 5, P4 = 0
Average Waiting Time = (11+2+5+0) / 4 = 4.5 ms
02
Click to edit Master title style
5
Shortest Job First(SJF)
with arrival time – Non Preemptive
Process AT BT CT TAT WT
P1 1 21 22 21 0
P2 3 3 27 24 21
P3 6 6 33 27 21
P4 7 2 24 17 15
P1 P4 P2 p3
TABLE
Gantt
Chart
22
TAT = CT – AT
WT = TAT - BT
Average Waiting Time = (0+21+21+15) / 4 = 14.25 ms
0 1 24 27 33
AT = Arrival Time
BT = Burst Time
CT = Completion Time
TAT = Turn Around Time
WT = Waiting Time
Average Turn Around Time = (21+24+27+17) / 4 = 22.25 ms
03
Click to edit Master title style
6
Priority Scheduling
without arrival time – Non Preemptive
Process Burst
Time
Priority
P1 10 3
P2 1 1
P3 2 4
P4 1 5
p5 5 2
P2 P5 P1 P3 p4
TABLE
Gantt
Chart
Waiting Time, P1 = 6, P2 = 0, P3 = 16 , P4 = 18, P5 = 1
Average Waiting Time = (6+0+16+18+1) / 5 = 8.2 ms
0 1 6 16 1918
Process Burst
Time
Priority
P2 1 1
P5 5 2
P1 10 3
P3 2 4
P4 1 5
Sorted Table
04
Click to edit Master title style
7
Priority Scheduling
with arrival time – Non Preemptive
Proces
s
AT BT Prio
rity
CT TAT WT
P1 0 6 2 6 6 0
P2 2 1 4 14 12 11
P3 4 4 1 10 6 2
P4 5 3 3 13 8 5
P1 P3 P4 P2
TABLE
Gantt
Chart
TAT = CT – AT
WT = TAT - BT
Average Waiting Time = (0+11+2+5) / 4 = 4.5 ms
60 10 13 14
AT = Arrival Time
BT = Burst Time
CT = Completion Time
TAT = Turn Around Time
WT = Waiting Time
Average Turn Around Time = (6+12+6+8) / 4 = 8 ms
05
Click to edit Master title style
8
Round-Robin Scheduling
without arrival time – Non Preemptive
P1 P2 P3 P4 P5 P1 P2 P4 p5 P1 P2 P5
TABLE
Gantt
Chart
Average TAT= (19+20+6+15+23) / 5 = 16.6 ms
0 2 17 19 23201264
Time Quantum = 2 ms
Arrival Time = 0
06
Process BT RT WT CT TAT
P1 6 4, 2, 0 13 19 19
P2 5 3,1,0 15 20 20
P3 2 0 4 6 6
P4 3 1,0 12 15 15
p5 7 5,3,0 16 23 23
AT = Arrival Time
BT = Burst Time
CT = Completion Time
TAT = Turn Around Time
WT = Waiting Time
Average Waiting Time = (13+15+4+12+16) / 5 = 12 ms
TAT = CT – AT
WT = TAT – BT
Ready Queue: P1, P2, P3, P4, P5, P1, P2, P4, P5, P1,P2, P5
8 10 14 15
Click to edit Master title style
9
Thank You

More Related Content

What's hot

First Come First Serve
First Come First ServeFirst Come First Serve
First Come First ServeEdwin Makeu
 
Real time scheduling - basic concepts
Real time scheduling - basic conceptsReal time scheduling - basic concepts
Real time scheduling - basic conceptsStudent
 
Booting of Computer System
Booting of Computer SystemBooting of Computer System
Booting of Computer SystemArzath Areeff
 
Introduction to Real-Time Operating Systems
Introduction to Real-Time Operating SystemsIntroduction to Real-Time Operating Systems
Introduction to Real-Time Operating Systemscoolmirza143
 
Shortest job first Scheduling (SJF)
Shortest job first Scheduling (SJF)Shortest job first Scheduling (SJF)
Shortest job first Scheduling (SJF)ritu98
 
Round Robin Scheduling Algorithm
Round Robin Scheduling AlgorithmRound Robin Scheduling Algorithm
Round Robin Scheduling AlgorithmAdeel Rasheed
 
COMPUTER MEMORY : TYPES & FUNCTIONS
COMPUTER MEMORY : TYPES & FUNCTIONSCOMPUTER MEMORY : TYPES & FUNCTIONS
COMPUTER MEMORY : TYPES & FUNCTIONSAngel Mary George
 
Operating Systems: Process Scheduling
Operating Systems: Process SchedulingOperating Systems: Process Scheduling
Operating Systems: Process SchedulingDamian T. Gordon
 
Linked allocation 48
Linked  allocation 48Linked  allocation 48
Linked allocation 48myrajendra
 
CPU Scheduling in OS Presentation
CPU Scheduling in OS  PresentationCPU Scheduling in OS  Presentation
CPU Scheduling in OS Presentationusmankiyani1
 

What's hot (20)

First Come First Serve
First Come First ServeFirst Come First Serve
First Come First Serve
 
Process Scheduling
Process SchedulingProcess Scheduling
Process Scheduling
 
Real time scheduling - basic concepts
Real time scheduling - basic conceptsReal time scheduling - basic concepts
Real time scheduling - basic concepts
 
cpu scheduling OS
 cpu scheduling OS cpu scheduling OS
cpu scheduling OS
 
5 Process Scheduling
5 Process Scheduling5 Process Scheduling
5 Process Scheduling
 
Booting of Computer System
Booting of Computer SystemBooting of Computer System
Booting of Computer System
 
Memory management
Memory managementMemory management
Memory management
 
Introduction to Real-Time Operating Systems
Introduction to Real-Time Operating SystemsIntroduction to Real-Time Operating Systems
Introduction to Real-Time Operating Systems
 
Process scheduling
Process schedulingProcess scheduling
Process scheduling
 
Shortest job first Scheduling (SJF)
Shortest job first Scheduling (SJF)Shortest job first Scheduling (SJF)
Shortest job first Scheduling (SJF)
 
Scheduling algorithms
Scheduling algorithmsScheduling algorithms
Scheduling algorithms
 
Evolution of os
Evolution of osEvolution of os
Evolution of os
 
Round Robin Scheduling Algorithm
Round Robin Scheduling AlgorithmRound Robin Scheduling Algorithm
Round Robin Scheduling Algorithm
 
COMPUTER MEMORY : TYPES & FUNCTIONS
COMPUTER MEMORY : TYPES & FUNCTIONSCOMPUTER MEMORY : TYPES & FUNCTIONS
COMPUTER MEMORY : TYPES & FUNCTIONS
 
Cpu scheduling
Cpu schedulingCpu scheduling
Cpu scheduling
 
Operating Systems: Process Scheduling
Operating Systems: Process SchedulingOperating Systems: Process Scheduling
Operating Systems: Process Scheduling
 
Linked allocation 48
Linked  allocation 48Linked  allocation 48
Linked allocation 48
 
Windows File Systems
Windows File SystemsWindows File Systems
Windows File Systems
 
Cs8493 unit 4
Cs8493 unit 4Cs8493 unit 4
Cs8493 unit 4
 
CPU Scheduling in OS Presentation
CPU Scheduling in OS  PresentationCPU Scheduling in OS  Presentation
CPU Scheduling in OS Presentation
 

Similar to CPU Scheduling Algorithm (SJF, Round-Robin, Priority)

Operating systems-presentation
Operating systems-presentationOperating systems-presentation
Operating systems-presentationmehedi15
 
cpu schduling ppt.pdf
cpu schduling ppt.pdfcpu schduling ppt.pdf
cpu schduling ppt.pdfSangeethaBS4
 
What is the waiting time of each process for each of the scheduling a.pdf
What is the waiting time of each process for each of the scheduling a.pdfWhat is the waiting time of each process for each of the scheduling a.pdf
What is the waiting time of each process for each of the scheduling a.pdfpearlcoburnsanche303
 
AlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorit...
AlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorit...AlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorit...
AlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorit...Shanmuganathan C
 
SCHEDULING RULES DONE.pptx
SCHEDULING  RULES DONE.pptxSCHEDULING  RULES DONE.pptx
SCHEDULING RULES DONE.pptxAgnibhaBanerjee1
 
Cpu Scheduling.pptx
Cpu Scheduling.pptxCpu Scheduling.pptx
Cpu Scheduling.pptxHaithamNagy
 
Operating system
Operating systemOperating system
Operating systemraeesa khan
 
Operating system
Operating systemOperating system
Operating systemLovly Angel
 
OS Process Chapter 3.pdf
OS Process Chapter 3.pdfOS Process Chapter 3.pdf
OS Process Chapter 3.pdfKp Sharma
 
CPU scheduling
CPU schedulingCPU scheduling
CPU schedulingAmir Khan
 
Scheduling 155 © David Lippman Creative Commons BY-SA.docx
Scheduling   155 © David Lippman  Creative Commons BY-SA.docxScheduling   155 © David Lippman  Creative Commons BY-SA.docx
Scheduling 155 © David Lippman Creative Commons BY-SA.docxdurantheseldine
 
OPERATING SYSTEM-"Scheduling policies"
OPERATING SYSTEM-"Scheduling policies"OPERATING SYSTEM-"Scheduling policies"
OPERATING SYSTEM-"Scheduling policies"Ankit Surti
 
Real-Time Scheduling
Real-Time SchedulingReal-Time Scheduling
Real-Time Schedulingsathish sak
 

Similar to CPU Scheduling Algorithm (SJF, Round-Robin, Priority) (19)

Cpu scheduling
Cpu schedulingCpu scheduling
Cpu scheduling
 
Operating systems-presentation
Operating systems-presentationOperating systems-presentation
Operating systems-presentation
 
Shortest Job First
Shortest Job FirstShortest Job First
Shortest Job First
 
cpu schduling ppt.pdf
cpu schduling ppt.pdfcpu schduling ppt.pdf
cpu schduling ppt.pdf
 
CPU Scheduling
CPU SchedulingCPU Scheduling
CPU Scheduling
 
Cpu Scheduling Galvin
Cpu Scheduling GalvinCpu Scheduling Galvin
Cpu Scheduling Galvin
 
What is the waiting time of each process for each of the scheduling a.pdf
What is the waiting time of each process for each of the scheduling a.pdfWhat is the waiting time of each process for each of the scheduling a.pdf
What is the waiting time of each process for each of the scheduling a.pdf
 
AlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorit...
AlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorit...AlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorit...
AlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorit...
 
SCHEDULING RULES DONE.pptx
SCHEDULING  RULES DONE.pptxSCHEDULING  RULES DONE.pptx
SCHEDULING RULES DONE.pptx
 
Cpu Scheduling.pptx
Cpu Scheduling.pptxCpu Scheduling.pptx
Cpu Scheduling.pptx
 
Operating system
Operating systemOperating system
Operating system
 
Operating system
Operating systemOperating system
Operating system
 
OS Process Chapter 3.pdf
OS Process Chapter 3.pdfOS Process Chapter 3.pdf
OS Process Chapter 3.pdf
 
CPU scheduling
CPU schedulingCPU scheduling
CPU scheduling
 
CPU Scheduling
CPU SchedulingCPU Scheduling
CPU Scheduling
 
Scheduling 155 © David Lippman Creative Commons BY-SA.docx
Scheduling   155 © David Lippman  Creative Commons BY-SA.docxScheduling   155 © David Lippman  Creative Commons BY-SA.docx
Scheduling 155 © David Lippman Creative Commons BY-SA.docx
 
Os module 2 ba
Os module 2 baOs module 2 ba
Os module 2 ba
 
OPERATING SYSTEM-"Scheduling policies"
OPERATING SYSTEM-"Scheduling policies"OPERATING SYSTEM-"Scheduling policies"
OPERATING SYSTEM-"Scheduling policies"
 
Real-Time Scheduling
Real-Time SchedulingReal-Time Scheduling
Real-Time Scheduling
 

Recently uploaded

Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfngoud9212
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsPrecisely
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 

Recently uploaded (20)

Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdf
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power Systems
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 

CPU Scheduling Algorithm (SJF, Round-Robin, Priority)

  • 1. Click to edit Master title style 1 CPU Scheduling Algorithm (SJF, Round-Robin, Priority) - Non Preemptive P r e s e n t e d B y M e h e n a z T a h e r i n S o l a i m a n H r i d o y M d . E h s a n u l I s l a m K h a n S a m i a A k t e r P u s h p i t a D u t t a I D : 1 7 0 1 0 1 1 4 I D : 1 7 0 1 0 1 1 5 I D : 1 7 0 1 0 1 1 6 I D : 1 7 0 1 0 1 1 7 I D : 1 7 0 1 0 1 1 8
  • 2. Click to edit Master title style 2 Table of Contents • Definitions …………………………………………………………………………….. 01 • Shortest Job First (SJF) – without arrival time …………………………..02 • Shortest Job First (SJF) – with arrival time ……………………………….03 • Priority – without arrival time …………………………………………………. 04 • Priority – with arrival time …………………………..…………………………..05 • Round-Robin – without arrival time …………….……………………………06
  • 3. Click to edit Master title style 3 Definitions • SJF : Shortest Job First scheduling works on the process with the shortest burst time or duration first. • Priority: In this scheduling, processes are scheduled according to their priorities, i.e., highest priority process is scheduled first. If priorities of two processes match, then schedule according to arrival time. • Round –Robin: A fixed time is allotted to each process, called quantum, for execution. Once a process is executed for given time period that process is preempted and other process executes for given time period. 01
  • 4. Click to edit Master title style 4 Shortest Job First(SJF) without arrival time – Non Preemptive Process Burst Time P1 21 P2 3 P3 6 P4 2 P4 P2 P3 P1 TABLE Gantt Chart 0 2 5 11 32 Waiting Time, P1 = 11, P2 = 2, P3 = 5, P4 = 0 Average Waiting Time = (11+2+5+0) / 4 = 4.5 ms 02
  • 5. Click to edit Master title style 5 Shortest Job First(SJF) with arrival time – Non Preemptive Process AT BT CT TAT WT P1 1 21 22 21 0 P2 3 3 27 24 21 P3 6 6 33 27 21 P4 7 2 24 17 15 P1 P4 P2 p3 TABLE Gantt Chart 22 TAT = CT – AT WT = TAT - BT Average Waiting Time = (0+21+21+15) / 4 = 14.25 ms 0 1 24 27 33 AT = Arrival Time BT = Burst Time CT = Completion Time TAT = Turn Around Time WT = Waiting Time Average Turn Around Time = (21+24+27+17) / 4 = 22.25 ms 03
  • 6. Click to edit Master title style 6 Priority Scheduling without arrival time – Non Preemptive Process Burst Time Priority P1 10 3 P2 1 1 P3 2 4 P4 1 5 p5 5 2 P2 P5 P1 P3 p4 TABLE Gantt Chart Waiting Time, P1 = 6, P2 = 0, P3 = 16 , P4 = 18, P5 = 1 Average Waiting Time = (6+0+16+18+1) / 5 = 8.2 ms 0 1 6 16 1918 Process Burst Time Priority P2 1 1 P5 5 2 P1 10 3 P3 2 4 P4 1 5 Sorted Table 04
  • 7. Click to edit Master title style 7 Priority Scheduling with arrival time – Non Preemptive Proces s AT BT Prio rity CT TAT WT P1 0 6 2 6 6 0 P2 2 1 4 14 12 11 P3 4 4 1 10 6 2 P4 5 3 3 13 8 5 P1 P3 P4 P2 TABLE Gantt Chart TAT = CT – AT WT = TAT - BT Average Waiting Time = (0+11+2+5) / 4 = 4.5 ms 60 10 13 14 AT = Arrival Time BT = Burst Time CT = Completion Time TAT = Turn Around Time WT = Waiting Time Average Turn Around Time = (6+12+6+8) / 4 = 8 ms 05
  • 8. Click to edit Master title style 8 Round-Robin Scheduling without arrival time – Non Preemptive P1 P2 P3 P4 P5 P1 P2 P4 p5 P1 P2 P5 TABLE Gantt Chart Average TAT= (19+20+6+15+23) / 5 = 16.6 ms 0 2 17 19 23201264 Time Quantum = 2 ms Arrival Time = 0 06 Process BT RT WT CT TAT P1 6 4, 2, 0 13 19 19 P2 5 3,1,0 15 20 20 P3 2 0 4 6 6 P4 3 1,0 12 15 15 p5 7 5,3,0 16 23 23 AT = Arrival Time BT = Burst Time CT = Completion Time TAT = Turn Around Time WT = Waiting Time Average Waiting Time = (13+15+4+12+16) / 5 = 12 ms TAT = CT – AT WT = TAT – BT Ready Queue: P1, P2, P3, P4, P5, P1, P2, P4, P5, P1,P2, P5 8 10 14 15
  • 9. Click to edit Master title style 9 Thank You