SlideShare a Scribd company logo
OPERATING SYSTEM
CPU Scheduling
Algorithm
SCHEDULING CRITERIA
There are many scheduling algorithms and various
criteria to judge their performance some criteria are
as follows:
o CPU Utilization: CPU should be busy (from 0 to
100%)
o Throughput: the number of process executed in a
specified time period
o Turnaround time: needed to execute a process
o Waiting Time: amount of time a process has
waited
o Response Time: between request and response
A CPU SCHEDULING ALGORITHM
MUST MAXIMIZE THE FOLLOWING
CPU utilization should maximum
Throughput should maximum
A CPU SCHEDULING ALGORITHM MUST
MINIMIZE THE FOLLOWING:
 Waiting Time should minimum
 Response Time should minimum
 Turnaround Time should minimum
SCHEDULING ALGORITHMS:
Below is the list of some well known
algorithms
First Come First Served (FCFS)
scheduling- non preemptive
Shortest job First(SJF) scheduling
preemptive non preemptive
Priority Scheduling preemptive non
preemptive
Round robin scheduling preemptive
TIMELINES:
Scheduling is based on the information
that is available at the give time. we
need some ways to represent the state
of the system and any process in it
and how it change over time.
Gantt chart are used for this purpose
to present them in graphical way.
GANTT CHART
1st Process 2nd Process More Processes
1st process end time 2nd Process end time…… End time.
Start time p1 end time p2end time……End time.
First come First Served (FCFS)
•Simplest
•Similar to queue
Process Name Start Time Burst Time
Process 1 0 24
Process 2 0 3
Process3 0 3
Example 1
Process1 Process2 Process3
0 24 27 30
FCFS
 The following table shows the waiting time for each
process:
Average Waiting time is(0+24+27)/3=17
Process
name
Arrival
time
Burst time Finish time Waiting
time
Process1 0 24 24 0
Process2 0 3 27 24
Process3 0 3 30 27
Gantt chart
P1 P2 P3
0 3 6
30
Process Name Start Time Burst Time
Process 2 0 3
Process 3 0 3
Process1 0 24
Example 2
Process
name
Arrival time Burst time Finish time Waiting
time
Process2 0 3 3 0
Process3 0 3 6 3
Process1 0 24 30 6
Average Waiting time is (0+3+6)/3= 3
Shortest Job First:
Another way to scheduling jobs is
to pick the job that will take least
amount of time to complete, based
on burst size. In this way the
average waiting time reduced.
•Normal SJF
•Non preemptive
• Preemptive
Non preemptive SJF Example:
Process name Arrival time Burst time
Process1 0 7
Process2 2 4
Process3 4 2
Process4 5 4
Process name Arrival time Burst time Finish time Waiting time
Process1 0 7 7 0
Process2 2 4 13 7
Process3 4 2 9 3
Process4 5 4 17 8
Process name Arrival time Burst time
Process1 0 7
Process2 2 4
Process3 4 1
Process4 5 4
Preemptive SJF Example 2
Process name Arrival time Burst time Finish time Waiting time
Process1 0 7 16 9
Process2 2 4 7 1
Process3 4 1 5 0
Process4 5 4 11 2
Requires that each process should
have priority associated with it.
Priority scheduling:
Priority scheduling Example for Non Preemptive
Process name Burst Time Priority
Process1 10 3
Process2 1 1
Process3 2 3
Process4 1 4
Process5 5 2
Process2 Process5 Process1 Process3 Process4
Priority scheduling Example Preemptive
Process name Arrival time Burst time Priority
Process1 0 10 3
Process2 2 1 1
Process3 4 2 2
Process4 6 1 4
Process5 8 5 5
Gantt Chart
0 1 6 16 18 ` 19
P1 P2 P1 P3 P1 P2 P5
Round robin scheduling
Gantt Chart
0 2 3 4 6 13 14
19
Another way to schedule jobs is to assign a small amount of
time to each process in which it executes. This time the unite
is called time quantum or tie slice, the job is allocated to CPU
for the quantum. when the time quantum expires, the process
preempted from CPU and replaced by next process in the
circle queue.
Process name Burst time
Process1 24
Process2 3
Process3 3
Gantt Chart
P1 P2 P3 P1 P1 P1 P1 P1
0 4 7 10 14 18 22 26 30
(10+7+30)/3=16
THANKS…..

More Related Content

What's hot

Priority scheduling algorithms
Priority scheduling algorithmsPriority scheduling algorithms
Priority scheduling algorithms
Daffodil International University
 
CPU Scheduling in OS Presentation
CPU Scheduling in OS  PresentationCPU Scheduling in OS  Presentation
CPU Scheduling in OS Presentation
usmankiyani1
 
SCHEDULING ALGORITHMS
SCHEDULING ALGORITHMSSCHEDULING ALGORITHMS
SCHEDULING ALGORITHMS
Margrat C R
 
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
 
OSCh6
OSCh6OSCh6
Process Scheduling
Process SchedulingProcess Scheduling
Round robin scheduling
Round robin schedulingRound robin scheduling
Round robin scheduling
Raghav S
 
9 cm402.19
9 cm402.199 cm402.19
9 cm402.19
myrajendra
 
17 cpu scheduling and scheduling criteria
17 cpu scheduling and scheduling criteria 17 cpu scheduling and scheduling criteria
17 cpu scheduling and scheduling criteria
myrajendra
 
cpu scheduling
cpu schedulingcpu scheduling
cpu scheduling
hashim102
 
Operating System-Process Scheduling
Operating System-Process SchedulingOperating System-Process Scheduling
Operating System-Process Scheduling
Shipra Swati
 
RR and priority scheduling
RR and priority schedulingRR and priority scheduling
RR and priority scheduling
A. S. M. Shafi
 
first come first serve scheduling in os
first come first serve scheduling in os first come first serve scheduling in os
first come first serve scheduling in os
mikeemukesh
 
Cp usched 2
Cp usched  2Cp usched  2
Cp usched 2
nidsrajdev
 
First Come First Serve
First Come First ServeFirst Come First Serve
First Come First Serve
Kavya Kapoor
 
Cpu scheduling
Cpu schedulingCpu scheduling
Cpu scheduling
marangburu42
 
5 Process Scheduling
5 Process Scheduling5 Process Scheduling
5 Process Scheduling
Dr. Loganathan R
 
CPU scheduling algorithms in OS
CPU scheduling algorithms in OSCPU scheduling algorithms in OS
CPU scheduling algorithms in OS
harini0810
 
CPU Scheduling Algorithms
CPU Scheduling AlgorithmsCPU Scheduling Algorithms
CPU Scheduling Algorithms
Tayba Farooqui
 
SCHEDULING ALGORITHMS
SCHEDULING ALGORITHMSSCHEDULING ALGORITHMS
SCHEDULING ALGORITHMS
Dhaval Sakhiya
 

What's hot (20)

Priority scheduling algorithms
Priority scheduling algorithmsPriority scheduling algorithms
Priority scheduling algorithms
 
CPU Scheduling in OS Presentation
CPU Scheduling in OS  PresentationCPU Scheduling in OS  Presentation
CPU Scheduling in OS Presentation
 
SCHEDULING ALGORITHMS
SCHEDULING ALGORITHMSSCHEDULING ALGORITHMS
SCHEDULING ALGORITHMS
 
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
 
OSCh6
OSCh6OSCh6
OSCh6
 
Process Scheduling
Process SchedulingProcess Scheduling
Process Scheduling
 
Round robin scheduling
Round robin schedulingRound robin scheduling
Round robin scheduling
 
9 cm402.19
9 cm402.199 cm402.19
9 cm402.19
 
17 cpu scheduling and scheduling criteria
17 cpu scheduling and scheduling criteria 17 cpu scheduling and scheduling criteria
17 cpu scheduling and scheduling criteria
 
cpu scheduling
cpu schedulingcpu scheduling
cpu scheduling
 
Operating System-Process Scheduling
Operating System-Process SchedulingOperating System-Process Scheduling
Operating System-Process Scheduling
 
RR and priority scheduling
RR and priority schedulingRR and priority scheduling
RR and priority scheduling
 
first come first serve scheduling in os
first come first serve scheduling in os first come first serve scheduling in os
first come first serve scheduling in os
 
Cp usched 2
Cp usched  2Cp usched  2
Cp usched 2
 
First Come First Serve
First Come First ServeFirst Come First Serve
First Come First Serve
 
Cpu scheduling
Cpu schedulingCpu scheduling
Cpu scheduling
 
5 Process Scheduling
5 Process Scheduling5 Process Scheduling
5 Process Scheduling
 
CPU scheduling algorithms in OS
CPU scheduling algorithms in OSCPU scheduling algorithms in OS
CPU scheduling algorithms in OS
 
CPU Scheduling Algorithms
CPU Scheduling AlgorithmsCPU Scheduling Algorithms
CPU Scheduling Algorithms
 
SCHEDULING ALGORITHMS
SCHEDULING ALGORITHMSSCHEDULING ALGORITHMS
SCHEDULING ALGORITHMS
 

Similar to 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) ...
Dr. Mazin Mohamed alkathiri
 
CPU Scheduling
CPU SchedulingCPU Scheduling
CPU Scheduling
M. Abdullah Wasif
 
Ch05 cpu-scheduling
Ch05 cpu-schedulingCh05 cpu-scheduling
Ch05 cpu-scheduling
Nazir Ahmed
 
CPU Scheduling.pdf
CPU Scheduling.pdfCPU Scheduling.pdf
CPU Scheduling
CPU SchedulingCPU Scheduling
CPU Scheduling
sammerkhan1
 
Cpu scheduling
Cpu schedulingCpu scheduling
Cpu scheduling
Arafat Hossan
 
Cpu Scheduling Galvin
Cpu Scheduling GalvinCpu Scheduling Galvin
Cpu Scheduling Galvin
Sonali Chauhan
 
Operating Systems Third Unit - Fourth Semester - Engineering
Operating Systems Third Unit  - Fourth Semester - EngineeringOperating Systems Third Unit  - Fourth Semester - Engineering
Operating Systems Third Unit - Fourth Semester - Engineering
Yogesh Santhan
 
CPU scheduling
CPU schedulingCPU scheduling
CPU scheduling
Amir Khan
 
Round-ribon algorithm presntation
Round-ribon algorithm presntationRound-ribon algorithm presntation
Round-ribon algorithm presntation
Jamsheed Ali
 
Operating systems - Processes Scheduling
Operating systems - Processes  SchedulingOperating systems - Processes  Scheduling
Operating systems - Processes Scheduling
Chandrakant Divate
 
OS Process Chapter 3.pdf
OS Process Chapter 3.pdfOS Process Chapter 3.pdf
OS Process Chapter 3.pdf
Kp Sharma
 
CH06.pdf
CH06.pdfCH06.pdf
CH06.pdf
ImranKhan880955
 
cpu schduling ppt.pdf
cpu schduling ppt.pdfcpu schduling ppt.pdf
cpu schduling ppt.pdf
SangeethaBS4
 
CPU Scheduling Lecture 5 - 6.pptx
CPU Scheduling Lecture 5 - 6.pptxCPU Scheduling Lecture 5 - 6.pptx
CPU Scheduling Lecture 5 - 6.pptx
Harry83774
 
Cpu_sheduling.pptx
Cpu_sheduling.pptxCpu_sheduling.pptx
Cpu_sheduling.pptx
satishkamble37
 
Unit iios process scheduling and synchronization
Unit iios process scheduling and synchronizationUnit iios process scheduling and synchronization
Unit iios process scheduling and synchronization
donny101
 
ch_scheduling (1).ppt
ch_scheduling (1).pptch_scheduling (1).ppt
ch_scheduling (1).ppt
Farhanahmad540205
 
Window scheduling algorithm
Window scheduling algorithmWindow scheduling algorithm
Window scheduling algorithm
Binal Parekh
 
Cpu scheduling
Cpu schedulingCpu scheduling
Cpu scheduling
mohsinalilarik1
 

Similar to Operating system (20)

OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...
 
CPU Scheduling
CPU SchedulingCPU Scheduling
CPU Scheduling
 
Ch05 cpu-scheduling
Ch05 cpu-schedulingCh05 cpu-scheduling
Ch05 cpu-scheduling
 
CPU Scheduling.pdf
CPU Scheduling.pdfCPU Scheduling.pdf
CPU Scheduling.pdf
 
CPU Scheduling
CPU SchedulingCPU Scheduling
CPU Scheduling
 
Cpu scheduling
Cpu schedulingCpu scheduling
Cpu scheduling
 
Cpu Scheduling Galvin
Cpu Scheduling GalvinCpu Scheduling Galvin
Cpu Scheduling Galvin
 
Operating Systems Third Unit - Fourth Semester - Engineering
Operating Systems Third Unit  - Fourth Semester - EngineeringOperating Systems Third Unit  - Fourth Semester - Engineering
Operating Systems Third Unit - Fourth Semester - Engineering
 
CPU scheduling
CPU schedulingCPU scheduling
CPU scheduling
 
Round-ribon algorithm presntation
Round-ribon algorithm presntationRound-ribon algorithm presntation
Round-ribon algorithm presntation
 
Operating systems - Processes Scheduling
Operating systems - Processes  SchedulingOperating systems - Processes  Scheduling
Operating systems - Processes Scheduling
 
OS Process Chapter 3.pdf
OS Process Chapter 3.pdfOS Process Chapter 3.pdf
OS Process Chapter 3.pdf
 
CH06.pdf
CH06.pdfCH06.pdf
CH06.pdf
 
cpu schduling ppt.pdf
cpu schduling ppt.pdfcpu schduling ppt.pdf
cpu schduling ppt.pdf
 
CPU Scheduling Lecture 5 - 6.pptx
CPU Scheduling Lecture 5 - 6.pptxCPU Scheduling Lecture 5 - 6.pptx
CPU Scheduling Lecture 5 - 6.pptx
 
Cpu_sheduling.pptx
Cpu_sheduling.pptxCpu_sheduling.pptx
Cpu_sheduling.pptx
 
Unit iios process scheduling and synchronization
Unit iios process scheduling and synchronizationUnit iios process scheduling and synchronization
Unit iios process scheduling and synchronization
 
ch_scheduling (1).ppt
ch_scheduling (1).pptch_scheduling (1).ppt
ch_scheduling (1).ppt
 
Window scheduling algorithm
Window scheduling algorithmWindow scheduling algorithm
Window scheduling algorithm
 
Cpu scheduling
Cpu schedulingCpu scheduling
Cpu scheduling
 

Recently uploaded

Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
amberjdewit93
 
How to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP ModuleHow to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP Module
Celine George
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
adhitya5119
 
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
PECB
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
heathfieldcps1
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
Jean Carlos Nunes Paixão
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
History of Stoke Newington
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
eBook.com.bd (প্রয়োজনীয় বাংলা বই)
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
Priyankaranawat4
 
How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
Celine George
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
Nicholas Montgomery
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
Nicholas Montgomery
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
Colégio Santa Teresinha
 
PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
AyyanKhan40
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
chanes7
 
How to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold MethodHow to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold Method
Celine George
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Akanksha trivedi rama nursing college kanpur.
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
WaniBasim
 

Recently uploaded (20)

Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
 
How to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP ModuleHow to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP Module
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
 
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
 
How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
 
PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
 
How to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold MethodHow to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold Method
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
 

Operating system

  • 2. SCHEDULING CRITERIA There are many scheduling algorithms and various criteria to judge their performance some criteria are as follows: o CPU Utilization: CPU should be busy (from 0 to 100%) o Throughput: the number of process executed in a specified time period o Turnaround time: needed to execute a process o Waiting Time: amount of time a process has waited o Response Time: between request and response
  • 3. A CPU SCHEDULING ALGORITHM MUST MAXIMIZE THE FOLLOWING CPU utilization should maximum Throughput should maximum
  • 4. A CPU SCHEDULING ALGORITHM MUST MINIMIZE THE FOLLOWING:  Waiting Time should minimum  Response Time should minimum  Turnaround Time should minimum
  • 5. SCHEDULING ALGORITHMS: Below is the list of some well known algorithms First Come First Served (FCFS) scheduling- non preemptive Shortest job First(SJF) scheduling preemptive non preemptive Priority Scheduling preemptive non preemptive Round robin scheduling preemptive
  • 6. TIMELINES: Scheduling is based on the information that is available at the give time. we need some ways to represent the state of the system and any process in it and how it change over time. Gantt chart are used for this purpose to present them in graphical way.
  • 7. GANTT CHART 1st Process 2nd Process More Processes 1st process end time 2nd Process end time…… End time. Start time p1 end time p2end time……End time. First come First Served (FCFS) •Simplest •Similar to queue
  • 8.
  • 9. Process Name Start Time Burst Time Process 1 0 24 Process 2 0 3 Process3 0 3 Example 1 Process1 Process2 Process3 0 24 27 30
  • 10. FCFS  The following table shows the waiting time for each process: Average Waiting time is(0+24+27)/3=17 Process name Arrival time Burst time Finish time Waiting time Process1 0 24 24 0 Process2 0 3 27 24 Process3 0 3 30 27
  • 11. Gantt chart P1 P2 P3 0 3 6 30 Process Name Start Time Burst Time Process 2 0 3 Process 3 0 3 Process1 0 24 Example 2
  • 12. Process name Arrival time Burst time Finish time Waiting time Process2 0 3 3 0 Process3 0 3 6 3 Process1 0 24 30 6 Average Waiting time is (0+3+6)/3= 3
  • 13. Shortest Job First: Another way to scheduling jobs is to pick the job that will take least amount of time to complete, based on burst size. In this way the average waiting time reduced. •Normal SJF •Non preemptive • Preemptive
  • 14.
  • 15.
  • 16. Non preemptive SJF Example: Process name Arrival time Burst time Process1 0 7 Process2 2 4 Process3 4 2 Process4 5 4
  • 17. Process name Arrival time Burst time Finish time Waiting time Process1 0 7 7 0 Process2 2 4 13 7 Process3 4 2 9 3 Process4 5 4 17 8
  • 18. Process name Arrival time Burst time Process1 0 7 Process2 2 4 Process3 4 1 Process4 5 4 Preemptive SJF Example 2
  • 19. Process name Arrival time Burst time Finish time Waiting time Process1 0 7 16 9 Process2 2 4 7 1 Process3 4 1 5 0 Process4 5 4 11 2
  • 20. Requires that each process should have priority associated with it. Priority scheduling: Priority scheduling Example for Non Preemptive Process name Burst Time Priority Process1 10 3 Process2 1 1 Process3 2 3 Process4 1 4 Process5 5 2
  • 21. Process2 Process5 Process1 Process3 Process4 Priority scheduling Example Preemptive Process name Arrival time Burst time Priority Process1 0 10 3 Process2 2 1 1 Process3 4 2 2 Process4 6 1 4 Process5 8 5 5 Gantt Chart 0 1 6 16 18 ` 19
  • 22. P1 P2 P1 P3 P1 P2 P5 Round robin scheduling Gantt Chart 0 2 3 4 6 13 14 19 Another way to schedule jobs is to assign a small amount of time to each process in which it executes. This time the unite is called time quantum or tie slice, the job is allocated to CPU for the quantum. when the time quantum expires, the process preempted from CPU and replaced by next process in the circle queue.
  • 23.
  • 24. Process name Burst time Process1 24 Process2 3 Process3 3 Gantt Chart P1 P2 P3 P1 P1 P1 P1 P1 0 4 7 10 14 18 22 26 30 (10+7+30)/3=16

Editor's Notes

  1. Raeesa imtiaz