SlideShare a Scribd company logo
What is the waiting time of each process for each of the scheduling algorithms?
Solution
First-Come, First-Served (FCFS) Scheduling
Process Burst Time
P1 24
P2 3
P3 3
Suppose that the processes arrive in the order: P1 , P2 , P3
The Gantt Chart for the schedule is:
P1
P2
P3
0 24 27 30
Waiting time for P1 = 0; P2 = 24; P3 = 27
SJF
Process Arrival Time Burst Time
P1 0.0 7
P2 2.0 4
P3 4.0 1
P4 5.0 4
SJF (non-preemptive)
P1
P3
P2
P4
0 7 8 12 16
Average waiting time = [0 +(8-2)+(7-4) +(12-5)] /4 =4
Example of Preemptive SJF
Proces Arrival Time Burst Time
P1 0.0 7
P2 2.0 4
P3 4.0 1
P4 5.0 4
SJF (preemptive)
P1
P2
P3
P2
P4
P1
0 2 4 5 7 11 16
Average waiting time = (9 + 1 + 0 +2)/4 =3
Round Robin (RR)
Each process gets a small unit of CPU time (time quantum), usually 10-100 milliseconds. After
this time has elapsed, the process is preempted and added to the end of the ready queue.
If there are n processes in the ready queue and the time quantum is q, then each process gets 1/n
of the
CPU time in chunks of at most q time units at once. No process waits more than (n-1)q time
units.
Performance
1. q large _ FIFO
2. q small _ q must be large with respect to context switch, otherwise overhead is too high.
Example of RR with Time Quantum = 4
Process Burst Time
P1 24
P2 3
P3 3
The Gantt chart is:
P1
P2
P3
P1
P1
P1
P1
P1
0 4 7 10 14 18 22 26 30
Average waiting time = [(30-24)+4+7]/3 = 17/3 =5.66
P1
P2
P3

More Related Content

Similar to What is the waiting time of each process for each of the scheduling a.pdf

Operating system
Operating systemOperating system
Operating system
raeesa khan
 
CPU Scheduling Algorithms
CPU Scheduling AlgorithmsCPU Scheduling Algorithms
CPU Scheduling Algorithms
Shubhashish Punj
 
AlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorit...
AlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorit...AlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorit...
AlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorit...
Shanmuganathan C
 
Cpu Scheduling.pptx
Cpu Scheduling.pptxCpu Scheduling.pptx
Cpu Scheduling.pptx
HaithamNagy
 
scheduling-algorithms.ppt
scheduling-algorithms.pptscheduling-algorithms.ppt
scheduling-algorithms.ppt
KIRANJOSE23
 
Operating systems-presentation
Operating systems-presentationOperating systems-presentation
Operating systems-presentation
mehedi15
 
scheduling-algorithms.pdf
scheduling-algorithms.pdfscheduling-algorithms.pdf
scheduling-algorithms.pdf
DeepakM509554
 
Operating systems - Processes Scheduling
Operating systems - Processes  SchedulingOperating systems - Processes  Scheduling
Operating systems - Processes Scheduling
Chandrakant Divate
 
Operating System 5
Operating System 5Operating System 5
Operating System 5tech2click
 
OS - CPU Scheduling
OS - CPU SchedulingOS - CPU Scheduling
OS - CPU Schedulingvinay arora
 
Cpu scheduling
Cpu schedulingCpu scheduling
Cpu scheduling
Abhijith Reloaded
 
CPU Scheduling
CPU SchedulingCPU Scheduling
CPU Scheduling
Farhat Shaikh
 
Process management in os
Process management in osProcess management in os
Process management in os
Miong Lazaro
 
CH06.pdf
CH06.pdfCH06.pdf
CH06.pdf
ImranKhan880955
 

Similar to What is the waiting time of each process for each of the scheduling a.pdf (20)

Operating system
Operating systemOperating system
Operating system
 
CPU Scheduling Algorithms
CPU Scheduling AlgorithmsCPU Scheduling Algorithms
CPU Scheduling Algorithms
 
AlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorit...
AlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorit...AlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorit...
AlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorit...
 
Cpu Scheduling Galvin
Cpu Scheduling GalvinCpu Scheduling Galvin
Cpu Scheduling Galvin
 
Cpu Scheduling.pptx
Cpu Scheduling.pptxCpu Scheduling.pptx
Cpu Scheduling.pptx
 
scheduling-algorithms.ppt
scheduling-algorithms.pptscheduling-algorithms.ppt
scheduling-algorithms.ppt
 
OS_Ch6
OS_Ch6OS_Ch6
OS_Ch6
 
OSCh6
OSCh6OSCh6
OSCh6
 
CPU Scheduling.pdf
CPU Scheduling.pdfCPU Scheduling.pdf
CPU Scheduling.pdf
 
Operating systems-presentation
Operating systems-presentationOperating systems-presentation
Operating systems-presentation
 
scheduling-algorithms.pdf
scheduling-algorithms.pdfscheduling-algorithms.pdf
scheduling-algorithms.pdf
 
Operating systems - Processes Scheduling
Operating systems - Processes  SchedulingOperating systems - Processes  Scheduling
Operating systems - Processes Scheduling
 
Operating System 5
Operating System 5Operating System 5
Operating System 5
 
OS - CPU Scheduling
OS - CPU SchedulingOS - CPU Scheduling
OS - CPU Scheduling
 
Ch5
Ch5Ch5
Ch5
 
Ch5 answers
Ch5 answersCh5 answers
Ch5 answers
 
Cpu scheduling
Cpu schedulingCpu scheduling
Cpu scheduling
 
CPU Scheduling
CPU SchedulingCPU Scheduling
CPU Scheduling
 
Process management in os
Process management in osProcess management in os
Process management in os
 
CH06.pdf
CH06.pdfCH06.pdf
CH06.pdf
 

More from pearlcoburnsanche303

Use the following information to answer questions 1-8. -Identify whet.pdf
Use the following information to answer questions 1-8. -Identify whet.pdfUse the following information to answer questions 1-8. -Identify whet.pdf
Use the following information to answer questions 1-8. -Identify whet.pdf
pearlcoburnsanche303
 
Until now, you have had to leave your team management program runnin.pdf
Until now, you have had to leave your team management program runnin.pdfUntil now, you have had to leave your team management program runnin.pdf
Until now, you have had to leave your team management program runnin.pdf
pearlcoburnsanche303
 
What are the various methods for recruiting employees Why are some .pdf
What are the various methods for recruiting employees Why are some .pdfWhat are the various methods for recruiting employees Why are some .pdf
What are the various methods for recruiting employees Why are some .pdf
pearlcoburnsanche303
 
Why is mobile computing so important to these three firms Evaluate .pdf
Why is mobile computing so important to these three firms Evaluate .pdfWhy is mobile computing so important to these three firms Evaluate .pdf
Why is mobile computing so important to these three firms Evaluate .pdf
pearlcoburnsanche303
 
When a heterozygous plant with round seeds is mated to a plant with .pdf
When a heterozygous plant with round seeds is mated to a plant with .pdfWhen a heterozygous plant with round seeds is mated to a plant with .pdf
When a heterozygous plant with round seeds is mated to a plant with .pdf
pearlcoburnsanche303
 
The mayor of a town has proposed a plan for the construction of an a.pdf
The mayor of a town has proposed a plan for the construction of an a.pdfThe mayor of a town has proposed a plan for the construction of an a.pdf
The mayor of a town has proposed a plan for the construction of an a.pdf
pearlcoburnsanche303
 
PROBLEM 5 Find the inverse of each ofthe following z-transforms .pdf
PROBLEM 5 Find the inverse of each ofthe following z-transforms .pdfPROBLEM 5 Find the inverse of each ofthe following z-transforms .pdf
PROBLEM 5 Find the inverse of each ofthe following z-transforms .pdf
pearlcoburnsanche303
 
The Hazen-Williams hydraulic formula for the mass-flow rate, m throug.pdf
The Hazen-Williams hydraulic formula for the mass-flow rate, m throug.pdfThe Hazen-Williams hydraulic formula for the mass-flow rate, m throug.pdf
The Hazen-Williams hydraulic formula for the mass-flow rate, m throug.pdf
pearlcoburnsanche303
 
The first crop produced by african slave labor in the Caribbean was _.pdf
The first crop produced by african slave labor in the Caribbean was _.pdfThe first crop produced by african slave labor in the Caribbean was _.pdf
The first crop produced by african slave labor in the Caribbean was _.pdf
pearlcoburnsanche303
 
The degree of freedom table is available online. Please answer A&B f.pdf
The degree of freedom table is available online. Please answer A&B f.pdfThe degree of freedom table is available online. Please answer A&B f.pdf
The degree of freedom table is available online. Please answer A&B f.pdf
pearlcoburnsanche303
 
the american red cross gives the following distribution for Blood Ty.pdf
the american red cross gives the following distribution for Blood Ty.pdfthe american red cross gives the following distribution for Blood Ty.pdf
the american red cross gives the following distribution for Blood Ty.pdf
pearlcoburnsanche303
 
Suppose that the probability that a head appears when a coin is tosse.pdf
Suppose that the probability that a head appears when a coin is tosse.pdfSuppose that the probability that a head appears when a coin is tosse.pdf
Suppose that the probability that a head appears when a coin is tosse.pdf
pearlcoburnsanche303
 
Suppose a student mbs a Teflon rod with wool and then briefly touches.pdf
Suppose a student mbs a Teflon rod with wool and then briefly touches.pdfSuppose a student mbs a Teflon rod with wool and then briefly touches.pdf
Suppose a student mbs a Teflon rod with wool and then briefly touches.pdf
pearlcoburnsanche303
 
Review the section Investigating Life Clues to the Origin of Langu.pdf
Review the section Investigating Life Clues to the Origin of Langu.pdfReview the section Investigating Life Clues to the Origin of Langu.pdf
Review the section Investigating Life Clues to the Origin of Langu.pdf
pearlcoburnsanche303
 
QUESTION 4 Choose true or false as applicable for each of the.pdf
QUESTION 4 Choose true or false as applicable for each of the.pdfQUESTION 4 Choose true or false as applicable for each of the.pdf
QUESTION 4 Choose true or false as applicable for each of the.pdf
pearlcoburnsanche303
 
Problem 4 Briefly, explain the steps of the Alkaline Lysis “minipre.pdf
Problem 4 Briefly, explain the steps of the Alkaline Lysis “minipre.pdfProblem 4 Briefly, explain the steps of the Alkaline Lysis “minipre.pdf
Problem 4 Briefly, explain the steps of the Alkaline Lysis “minipre.pdf
pearlcoburnsanche303
 
Please explain In a Drosophila dihybrid cross, a sepia male was mate.pdf
Please explain In a Drosophila dihybrid cross, a sepia male was mate.pdfPlease explain In a Drosophila dihybrid cross, a sepia male was mate.pdf
Please explain In a Drosophila dihybrid cross, a sepia male was mate.pdf
pearlcoburnsanche303
 
Ganges River question The Ganges River, shown in Figure 4.57, has an.pdf
Ganges River question The Ganges River, shown in Figure 4.57, has an.pdfGanges River question The Ganges River, shown in Figure 4.57, has an.pdf
Ganges River question The Ganges River, shown in Figure 4.57, has an.pdf
pearlcoburnsanche303
 
Locomotion is important for many Bacteria Which of the following are .pdf
Locomotion is important for many Bacteria Which of the following are .pdfLocomotion is important for many Bacteria Which of the following are .pdf
Locomotion is important for many Bacteria Which of the following are .pdf
pearlcoburnsanche303
 
List the three subpathways of cellular respiration and the results o.pdf
List the three subpathways of cellular respiration and the results o.pdfList the three subpathways of cellular respiration and the results o.pdf
List the three subpathways of cellular respiration and the results o.pdf
pearlcoburnsanche303
 

More from pearlcoburnsanche303 (20)

Use the following information to answer questions 1-8. -Identify whet.pdf
Use the following information to answer questions 1-8. -Identify whet.pdfUse the following information to answer questions 1-8. -Identify whet.pdf
Use the following information to answer questions 1-8. -Identify whet.pdf
 
Until now, you have had to leave your team management program runnin.pdf
Until now, you have had to leave your team management program runnin.pdfUntil now, you have had to leave your team management program runnin.pdf
Until now, you have had to leave your team management program runnin.pdf
 
What are the various methods for recruiting employees Why are some .pdf
What are the various methods for recruiting employees Why are some .pdfWhat are the various methods for recruiting employees Why are some .pdf
What are the various methods for recruiting employees Why are some .pdf
 
Why is mobile computing so important to these three firms Evaluate .pdf
Why is mobile computing so important to these three firms Evaluate .pdfWhy is mobile computing so important to these three firms Evaluate .pdf
Why is mobile computing so important to these three firms Evaluate .pdf
 
When a heterozygous plant with round seeds is mated to a plant with .pdf
When a heterozygous plant with round seeds is mated to a plant with .pdfWhen a heterozygous plant with round seeds is mated to a plant with .pdf
When a heterozygous plant with round seeds is mated to a plant with .pdf
 
The mayor of a town has proposed a plan for the construction of an a.pdf
The mayor of a town has proposed a plan for the construction of an a.pdfThe mayor of a town has proposed a plan for the construction of an a.pdf
The mayor of a town has proposed a plan for the construction of an a.pdf
 
PROBLEM 5 Find the inverse of each ofthe following z-transforms .pdf
PROBLEM 5 Find the inverse of each ofthe following z-transforms .pdfPROBLEM 5 Find the inverse of each ofthe following z-transforms .pdf
PROBLEM 5 Find the inverse of each ofthe following z-transforms .pdf
 
The Hazen-Williams hydraulic formula for the mass-flow rate, m throug.pdf
The Hazen-Williams hydraulic formula for the mass-flow rate, m throug.pdfThe Hazen-Williams hydraulic formula for the mass-flow rate, m throug.pdf
The Hazen-Williams hydraulic formula for the mass-flow rate, m throug.pdf
 
The first crop produced by african slave labor in the Caribbean was _.pdf
The first crop produced by african slave labor in the Caribbean was _.pdfThe first crop produced by african slave labor in the Caribbean was _.pdf
The first crop produced by african slave labor in the Caribbean was _.pdf
 
The degree of freedom table is available online. Please answer A&B f.pdf
The degree of freedom table is available online. Please answer A&B f.pdfThe degree of freedom table is available online. Please answer A&B f.pdf
The degree of freedom table is available online. Please answer A&B f.pdf
 
the american red cross gives the following distribution for Blood Ty.pdf
the american red cross gives the following distribution for Blood Ty.pdfthe american red cross gives the following distribution for Blood Ty.pdf
the american red cross gives the following distribution for Blood Ty.pdf
 
Suppose that the probability that a head appears when a coin is tosse.pdf
Suppose that the probability that a head appears when a coin is tosse.pdfSuppose that the probability that a head appears when a coin is tosse.pdf
Suppose that the probability that a head appears when a coin is tosse.pdf
 
Suppose a student mbs a Teflon rod with wool and then briefly touches.pdf
Suppose a student mbs a Teflon rod with wool and then briefly touches.pdfSuppose a student mbs a Teflon rod with wool and then briefly touches.pdf
Suppose a student mbs a Teflon rod with wool and then briefly touches.pdf
 
Review the section Investigating Life Clues to the Origin of Langu.pdf
Review the section Investigating Life Clues to the Origin of Langu.pdfReview the section Investigating Life Clues to the Origin of Langu.pdf
Review the section Investigating Life Clues to the Origin of Langu.pdf
 
QUESTION 4 Choose true or false as applicable for each of the.pdf
QUESTION 4 Choose true or false as applicable for each of the.pdfQUESTION 4 Choose true or false as applicable for each of the.pdf
QUESTION 4 Choose true or false as applicable for each of the.pdf
 
Problem 4 Briefly, explain the steps of the Alkaline Lysis “minipre.pdf
Problem 4 Briefly, explain the steps of the Alkaline Lysis “minipre.pdfProblem 4 Briefly, explain the steps of the Alkaline Lysis “minipre.pdf
Problem 4 Briefly, explain the steps of the Alkaline Lysis “minipre.pdf
 
Please explain In a Drosophila dihybrid cross, a sepia male was mate.pdf
Please explain In a Drosophila dihybrid cross, a sepia male was mate.pdfPlease explain In a Drosophila dihybrid cross, a sepia male was mate.pdf
Please explain In a Drosophila dihybrid cross, a sepia male was mate.pdf
 
Ganges River question The Ganges River, shown in Figure 4.57, has an.pdf
Ganges River question The Ganges River, shown in Figure 4.57, has an.pdfGanges River question The Ganges River, shown in Figure 4.57, has an.pdf
Ganges River question The Ganges River, shown in Figure 4.57, has an.pdf
 
Locomotion is important for many Bacteria Which of the following are .pdf
Locomotion is important for many Bacteria Which of the following are .pdfLocomotion is important for many Bacteria Which of the following are .pdf
Locomotion is important for many Bacteria Which of the following are .pdf
 
List the three subpathways of cellular respiration and the results o.pdf
List the three subpathways of cellular respiration and the results o.pdfList the three subpathways of cellular respiration and the results o.pdf
List the three subpathways of cellular respiration and the results o.pdf
 

Recently uploaded

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdfESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
Fundacja Rozwoju Społeczeństwa Przedsiębiorczego
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
How to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS ModuleHow to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS Module
Celine George
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
kaushalkr1407
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
The Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve ThomasonThe Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve Thomason
Steve Thomason
 
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxStudents, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
EduSkills OECD
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
Jheel Barad
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
PART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePART A. Introduction to Costumer Service
PART A. Introduction to Costumer Service
PedroFerreira53928
 
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
Nguyen Thanh Tu Collection
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 

Recently uploaded (20)

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdfESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
How to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS ModuleHow to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS Module
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
The Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve ThomasonThe Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve Thomason
 
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxStudents, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
PART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePART A. Introduction to Costumer Service
PART A. Introduction to Costumer Service
 
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 

What is the waiting time of each process for each of the scheduling a.pdf

  • 1. What is the waiting time of each process for each of the scheduling algorithms? Solution First-Come, First-Served (FCFS) Scheduling Process Burst Time P1 24 P2 3 P3 3 Suppose that the processes arrive in the order: P1 , P2 , P3 The Gantt Chart for the schedule is: P1 P2 P3 0 24 27 30 Waiting time for P1 = 0; P2 = 24; P3 = 27 SJF Process Arrival Time Burst Time P1 0.0 7 P2 2.0 4 P3 4.0 1 P4 5.0 4 SJF (non-preemptive) P1 P3 P2 P4 0 7 8 12 16 Average waiting time = [0 +(8-2)+(7-4) +(12-5)] /4 =4 Example of Preemptive SJF Proces Arrival Time Burst Time P1 0.0 7 P2 2.0 4
  • 2. P3 4.0 1 P4 5.0 4 SJF (preemptive) P1 P2 P3 P2 P4 P1 0 2 4 5 7 11 16 Average waiting time = (9 + 1 + 0 +2)/4 =3 Round Robin (RR) Each process gets a small unit of CPU time (time quantum), usually 10-100 milliseconds. After this time has elapsed, the process is preempted and added to the end of the ready queue. If there are n processes in the ready queue and the time quantum is q, then each process gets 1/n of the CPU time in chunks of at most q time units at once. No process waits more than (n-1)q time units. Performance 1. q large _ FIFO 2. q small _ q must be large with respect to context switch, otherwise overhead is too high. Example of RR with Time Quantum = 4 Process Burst Time P1 24 P2 3 P3 3 The Gantt chart is: P1 P2 P3 P1 P1 P1 P1 P1 0 4 7 10 14 18 22 26 30
  • 3. Average waiting time = [(30-24)+4+7]/3 = 17/3 =5.66 P1 P2 P3