SlideShare a Scribd company logo
1 of 3
Download to read offline
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

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

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
 
OSCh6
OSCh6OSCh6
OSCh6
 
OS_Ch6
OS_Ch6OS_Ch6
OS_Ch6
 
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 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
 
Ch05 cpu-scheduling
Ch05 cpu-schedulingCh05 cpu-scheduling
Ch05 cpu-scheduling
 
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
 
CPU Scheduling Lecture 5 - 6.pptx
CPU Scheduling Lecture 5 - 6.pptxCPU Scheduling Lecture 5 - 6.pptx
CPU Scheduling Lecture 5 - 6.pptx
 

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.pdfpearlcoburnsanche303
 
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.pdfpearlcoburnsanche303
 
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 .pdfpearlcoburnsanche303
 
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 .pdfpearlcoburnsanche303
 
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 .pdfpearlcoburnsanche303
 
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.pdfpearlcoburnsanche303
 
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 .pdfpearlcoburnsanche303
 
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.pdfpearlcoburnsanche303
 
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 _.pdfpearlcoburnsanche303
 
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.pdfpearlcoburnsanche303
 
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.pdfpearlcoburnsanche303
 
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.pdfpearlcoburnsanche303
 
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.pdfpearlcoburnsanche303
 
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.pdfpearlcoburnsanche303
 
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.pdfpearlcoburnsanche303
 
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.pdfpearlcoburnsanche303
 
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.pdfpearlcoburnsanche303
 
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.pdfpearlcoburnsanche303
 
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 .pdfpearlcoburnsanche303
 
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.pdfpearlcoburnsanche303
 

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

Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfUmakantAnnand
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfakmcokerachita
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 

Recently uploaded (20)

Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.Compdf
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdf
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 

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