SlideShare a Scribd company logo
1 of 20
University of Science & Technology
Chittagong
Course title: Operating Systems
Course code: CSE 327
Department of Computer Science & Engineering
(CSE)
1
Submitted by :
Piku Das (17010110)
Mizanur Rahman (17010108)
Israt Liza (17010111)
Eftykher Mahmud( 17010112)
Sushmita Dey (17010113)
Batch No : 29
Submitted to :
Fatema Tuj Zohra
(Lecturer of CSE
Department)
|
|
Presentation on
CPU Scheduling
2
Why CPU scheduling ?
One of the key goal of an operating system is to
utilize the the CPU as much as possible.
There is a situation for underutilization of CPU
because most of the component of a computer is
not as fast as the microprocessor.
To overcome the problem of underutilization of
CPU and main memory, the multiprogramming
was introduced. The objective of
multiprogramming is to have some process
running all the time. 3
Why CPU scheduling ? (cont… .)
So to implement the concept of multiprogramming we
need to design scheduling algorithms.
Whenever the CPU becomes idle , the OS must choose
one of the process in the ready queue to be executed .
The selection process is carried out by a short term
scheduler or CPU scheduler .
4
5
Preemptive Vs Non-Preemptive
Preemptive Non-Preemptive
1. Allocation For Resource
to process for Limited Time.
1. Process holds the resource till
Terminated or Switch to Waiting
State.
2. Process Can be
Interrupted in between
2. Process Can’t be Interrupted
until it terminated or switching
waiting state
3. High CPU Utilization 3. Low CPU Utilization
4. In Preemptive
Scheduling, a running
process may be replaced by
a higher priority process at
any time
4. In Non- Preemptive Scheduling,
Once the CPU has been allocated to
a process ,the process keeps the
CPU it releases the CPU either by
terminated by switching the
6
Preemptive Non-Preemptive
5. Preemptive Scheduling is
Flexible
5. Preemptive Scheduling is
Rigid
6. Preemptive Scheduling is
more Complex
6. Non-Preemptive
Scheduling is Simple but it is
less efficient
7. Preemptive Scheduling is
not attractive
7. Non-Preemptive
Scheduling is more attractive
because of its simplicity
8. Preemptive Scheduling is
cost associative
8. Non-Preemptive
Scheduling is not cost
associative
Preemptive Vs Non-Preemptive
7
9.Used in time sharing
System
9.Not suitible for time sharing
System.
10.Switching Overhead 10.Not Switching Overhead
11.SJF (Shortest Job First )
Scheduling,
Round Robin Scheduling
11. FCFS(First come First
Serve)
Preemptive Vs Non-Preemptive
8
CPU Scheduling Criteria
Scheduling Criteria:
 There are several different criteria to consider when
trying to select the "best" scheduling algorithm for a
particular situation and environment, including:
 CPU utilization - Ideally the CPU would be busy 100% of
the time, so as to waste 0 CPU cycles. On a real system CPU
usage should range from 40% ( lightly loaded ) to 90% (
heavily loaded. )
 Number of processes completed per unit time. May range
from 10 / second to 1 / hour depending on the specific
processes.
9
 Turnaround time - Time required for a particular process
to complete, from submission time to completion.
( Wall clock time. )
 Waiting time - How much time processes spend in the
ready queue waiting their turn to get on the CPU. ( Load
average - The average number of processes sitting in the
ready queue waiting their turn to get into the CPU.
 Reported in 1-minute, 5-minute, and 15-minute averages
by "uptime" and "who". ) Response time - The time taken in
an interactive program from the issuance of a command to
the commence of a response to that command.
CPU Scheduling Criteria
10
In general one wants to optimize the average value of a
criteria ( Maximize CPU utilization and throughput, and
minimize all the others. ) However some times one wants to do
something different, such as to minimize the maximum
response time.
 Sometimes it is most desirable to minimize the variance of a
criteria than the actual value. I.e. users are more accepting of a
consistent predictable system than an inconsistent one, even if
it is a little bit slower.
CPU Scheduling Criteria
What is FCFS?
 FCFS or First come first serve is an
operating system process Scheduling
algorithm that automatically executes queued
requests and processes by order of their
arrival.
5
i. Jobs are executed on first come, first serve
basis.
ii. It is an non-preemptive scheduling
algorithm.
iii.It’s implementation is based on FIFO queue.
iv.OS runs the process at head of the queue.
FCFS Basic Concepts
12
Two kinds of non-preemptive FCFS
 With priority scheme.
 No priority scheme.
Advantages
13
i. Simple Algorithm.
ii. It is simple to understand and code.
iii. Suitable for batch system.
i. Because of non-preemptive algorithm the waiting time
can be large if short request behind the long process.
ii. Not suitable for sharing system.
iii. Because of long average waiting time the performance
is poor.
Disadvantages
FCFS CPU Scheduling Algorithm
Without Arrival Time
14
Process:
The processes arrive in the order P1, P2, P3 and are served
as per the FCFS algorithm. The Gantt chart is as shown:
P1 P2 P3
0 25 29 32
Fig: Gantt Chart
16
Process Burst Time Waiting
Time
Completion
Time
Turn Around
Time
P1 25 0 25 25
P2 4 25 29 29
P3 3 29 32 32
 Formula:
 Completion Time: Time at which process completes its
execution.
 Turn Around Time: Turn Around Time = Completion Time –
Arrival Time.
 Waiting Time(W.T): Waiting Time = Turn Around Time –
Burst Time.
Average waiting time = (0+25+29)/3
= 18millisecond.
Average T.A.T = (25+29+32)/3
FCFS CPU Scheduling With Arrival Time
17
Process Arrival Time Burst Time
P0 0 2
P1 1 6
P2 2 4
P3 3 9
P4 4 12
Process:
Process Arrival Time Burst Time
P0 0 2
P1 1 6
P2 2 4
P3 3 9
P4 4 12
The processes arrive in the order P1, P2, P3 and P4 are served as per
the FCFS algorithm. The Gantt chart is as shown:
P0 P1 P2 P3 P4
8 12 21 330 2
Fig: Gantt chart
19
Process Arrival Time Burst Time Completion
Time
Waiting Time Turn Around
Time
P0 0 2 2 0 2
P1 1 6 8 1 7
P2 2 4 12 6 10
P3 3 9 21 9 18
P4 4 12 33 17 29
 Formula:
 Completion Time: Time at which process completes its
execution.
 Turn Around Time: Turn Around Time = Completion Time –
Arrival Time.
 Waiting Time(W.T): Waiting Time = Turn Around Time – Burst
Time.
Average waiting time = (0+1+6+9+17) / 5
= 6.6ms.
Average T.A.T = (2+7+10+18+29) / 5
Thanks Everyone
THE END
20

More Related Content

What's hot

Lecture 6- Deadlocks.pptx
Lecture 6- Deadlocks.pptxLecture 6- Deadlocks.pptx
Lecture 6- Deadlocks.pptxAmanuelmergia
 
DeadLock in Operating-Systems
DeadLock in Operating-SystemsDeadLock in Operating-Systems
DeadLock in Operating-SystemsVenkata Sreeram
 
Thread scheduling in Operating Systems
Thread scheduling in Operating SystemsThread scheduling in Operating Systems
Thread scheduling in Operating SystemsNitish Gulati
 
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
 
Round Robin Scheduling Algorithm
Round Robin Scheduling AlgorithmRound Robin Scheduling Algorithm
Round Robin Scheduling AlgorithmAdeel Rasheed
 
OS - Process Concepts
OS - Process ConceptsOS - Process Concepts
OS - Process ConceptsMukesh Chinta
 
Operating Systems: Process Scheduling
Operating Systems: Process SchedulingOperating Systems: Process Scheduling
Operating Systems: Process SchedulingDamian T. Gordon
 
Operating System Deadlock Galvin
Operating System  Deadlock GalvinOperating System  Deadlock Galvin
Operating System Deadlock GalvinSonali Chauhan
 
Operating Systems Process Scheduling Algorithms
Operating Systems   Process Scheduling AlgorithmsOperating Systems   Process Scheduling Algorithms
Operating Systems Process Scheduling Algorithmssathish sak
 
Module 3-cpu-scheduling
Module 3-cpu-schedulingModule 3-cpu-scheduling
Module 3-cpu-schedulingHesham Elmasry
 
Hardware multithreading
Hardware multithreadingHardware multithreading
Hardware multithreadingFraboni Ec
 

What's hot (20)

CPU Scheduling Algorithms
CPU Scheduling AlgorithmsCPU Scheduling Algorithms
CPU Scheduling Algorithms
 
SCHEDULING ALGORITHMS
SCHEDULING ALGORITHMSSCHEDULING ALGORITHMS
SCHEDULING ALGORITHMS
 
5 Process Scheduling
5 Process Scheduling5 Process Scheduling
5 Process Scheduling
 
Shortest Job First
Shortest Job FirstShortest Job First
Shortest Job First
 
Lecture 6- Deadlocks.pptx
Lecture 6- Deadlocks.pptxLecture 6- Deadlocks.pptx
Lecture 6- Deadlocks.pptx
 
DeadLock in Operating-Systems
DeadLock in Operating-SystemsDeadLock in Operating-Systems
DeadLock in Operating-Systems
 
Thread scheduling in Operating Systems
Thread scheduling in Operating SystemsThread scheduling in Operating Systems
Thread scheduling in Operating Systems
 
17 cpu scheduling and scheduling criteria
17 cpu scheduling and scheduling criteria 17 cpu scheduling and scheduling criteria
17 cpu scheduling and scheduling criteria
 
Round Robin Scheduling Algorithm
Round Robin Scheduling AlgorithmRound Robin Scheduling Algorithm
Round Robin Scheduling Algorithm
 
OS - Process Concepts
OS - Process ConceptsOS - Process Concepts
OS - Process Concepts
 
Opetating System Memory management
Opetating System Memory managementOpetating System Memory management
Opetating System Memory management
 
Cpu scheduling
Cpu schedulingCpu scheduling
Cpu scheduling
 
Operating system critical section
Operating system   critical sectionOperating system   critical section
Operating system critical section
 
5 csp
5 csp5 csp
5 csp
 
Cpu scheduling
Cpu schedulingCpu scheduling
Cpu scheduling
 
Operating Systems: Process Scheduling
Operating Systems: Process SchedulingOperating Systems: Process Scheduling
Operating Systems: Process Scheduling
 
Operating System Deadlock Galvin
Operating System  Deadlock GalvinOperating System  Deadlock Galvin
Operating System Deadlock Galvin
 
Operating Systems Process Scheduling Algorithms
Operating Systems   Process Scheduling AlgorithmsOperating Systems   Process Scheduling Algorithms
Operating Systems Process Scheduling Algorithms
 
Module 3-cpu-scheduling
Module 3-cpu-schedulingModule 3-cpu-scheduling
Module 3-cpu-scheduling
 
Hardware multithreading
Hardware multithreadingHardware multithreading
Hardware multithreading
 

Similar to Cpu scheduling

chapter 5 CPU scheduling.ppt
chapter  5 CPU scheduling.pptchapter  5 CPU scheduling.ppt
chapter 5 CPU scheduling.pptKeyreSebre
 
Preemptive process example.pptx
Preemptive process example.pptxPreemptive process example.pptx
Preemptive process example.pptxjamilaltiti1
 
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 - EngineeringYogesh Santhan
 
Scheduling algo(by HJ)
Scheduling algo(by HJ)Scheduling algo(by HJ)
Scheduling algo(by HJ)Harshit Jain
 
Operating System-Process Scheduling
Operating System-Process SchedulingOperating System-Process Scheduling
Operating System-Process SchedulingShipra Swati
 
CPU scheduling in Operating System Explanation
CPU scheduling in Operating System ExplanationCPU scheduling in Operating System Explanation
CPU scheduling in Operating System ExplanationAnitaSofiaKeyser
 
Process scheduling (CPU Scheduling)
Process scheduling (CPU Scheduling)Process scheduling (CPU Scheduling)
Process scheduling (CPU Scheduling)Mukesh Chinta
 
Welcome to International Journal of Engineering Research and Development (IJERD)
Welcome to International Journal of Engineering Research and Development (IJERD)Welcome to International Journal of Engineering Research and Development (IJERD)
Welcome to International Journal of Engineering Research and Development (IJERD)IJERD Editor
 
20118016 aryan sabat study and analysis of scheduler design
20118016 aryan sabat study and analysis of scheduler design20118016 aryan sabat study and analysis of scheduler design
20118016 aryan sabat study and analysis of scheduler design8016AryanSabat
 
Cpu scheduling final
Cpu scheduling finalCpu scheduling final
Cpu scheduling finalmarangburu42
 
Scheduling algorithm (chammu)
Scheduling algorithm (chammu)Scheduling algorithm (chammu)
Scheduling algorithm (chammu)Nagarajan
 
cpu scheduling by shivam singh
cpu scheduling by shivam singhcpu scheduling by shivam singh
cpu scheduling by shivam singhshivam71291
 
CPU scheduling
CPU schedulingCPU scheduling
CPU schedulingAmir Khan
 
Cpu scheduling pre final formatting
Cpu scheduling pre final formattingCpu scheduling pre final formatting
Cpu scheduling pre final formattingmarangburu42
 

Similar to Cpu scheduling (20)

chapter 5 CPU scheduling.ppt
chapter  5 CPU scheduling.pptchapter  5 CPU scheduling.ppt
chapter 5 CPU scheduling.ppt
 
Preemptive process example.pptx
Preemptive process example.pptxPreemptive process example.pptx
Preemptive process example.pptx
 
Cpu scheduling
Cpu schedulingCpu scheduling
Cpu scheduling
 
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
 
Scheduling algo(by HJ)
Scheduling algo(by HJ)Scheduling algo(by HJ)
Scheduling algo(by HJ)
 
Operating System-Process Scheduling
Operating System-Process SchedulingOperating System-Process Scheduling
Operating System-Process Scheduling
 
CPU Scheduling
CPU SchedulingCPU Scheduling
CPU Scheduling
 
CPU scheduling in Operating System Explanation
CPU scheduling in Operating System ExplanationCPU scheduling in Operating System Explanation
CPU scheduling in Operating System Explanation
 
Process scheduling (CPU Scheduling)
Process scheduling (CPU Scheduling)Process scheduling (CPU Scheduling)
Process scheduling (CPU Scheduling)
 
Welcome to International Journal of Engineering Research and Development (IJERD)
Welcome to International Journal of Engineering Research and Development (IJERD)Welcome to International Journal of Engineering Research and Development (IJERD)
Welcome to International Journal of Engineering Research and Development (IJERD)
 
20118016 aryan sabat study and analysis of scheduler design
20118016 aryan sabat study and analysis of scheduler design20118016 aryan sabat study and analysis of scheduler design
20118016 aryan sabat study and analysis of scheduler design
 
Cpu scheduling final
Cpu scheduling finalCpu scheduling final
Cpu scheduling final
 
Osy ppt - Copy.pptx
Osy ppt - Copy.pptxOsy ppt - Copy.pptx
Osy ppt - Copy.pptx
 
Unit 2 notes
Unit 2 notesUnit 2 notes
Unit 2 notes
 
Section05 scheduling
Section05 schedulingSection05 scheduling
Section05 scheduling
 
Scheduling algorithm (chammu)
Scheduling algorithm (chammu)Scheduling algorithm (chammu)
Scheduling algorithm (chammu)
 
cpu scheduling by shivam singh
cpu scheduling by shivam singhcpu scheduling by shivam singh
cpu scheduling by shivam singh
 
OS ASSIGNMENT.pptx
OS ASSIGNMENT.pptxOS ASSIGNMENT.pptx
OS ASSIGNMENT.pptx
 
CPU scheduling
CPU schedulingCPU scheduling
CPU scheduling
 
Cpu scheduling pre final formatting
Cpu scheduling pre final formattingCpu scheduling pre final formatting
Cpu scheduling pre final formatting
 

Recently uploaded

(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...VICTOR MAESTRE RAMIREZ
 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2RajaP95
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...srsj9000
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝soniya singh
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learningmisbanausheenparvam
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and usesDevarapalliHaritha
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfAsst.prof M.Gokilavani
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx959SahilShah
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
microprocessor 8085 and its interfacing
microprocessor 8085  and its interfacingmicroprocessor 8085  and its interfacing
microprocessor 8085 and its interfacingjaychoudhary37
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 

Recently uploaded (20)

(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...
 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learning
 
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and uses
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
 
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
microprocessor 8085 and its interfacing
microprocessor 8085  and its interfacingmicroprocessor 8085  and its interfacing
microprocessor 8085 and its interfacing
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 

Cpu scheduling

  • 1. University of Science & Technology Chittagong Course title: Operating Systems Course code: CSE 327 Department of Computer Science & Engineering (CSE) 1 Submitted by : Piku Das (17010110) Mizanur Rahman (17010108) Israt Liza (17010111) Eftykher Mahmud( 17010112) Sushmita Dey (17010113) Batch No : 29 Submitted to : Fatema Tuj Zohra (Lecturer of CSE Department) | |
  • 3. Why CPU scheduling ? One of the key goal of an operating system is to utilize the the CPU as much as possible. There is a situation for underutilization of CPU because most of the component of a computer is not as fast as the microprocessor. To overcome the problem of underutilization of CPU and main memory, the multiprogramming was introduced. The objective of multiprogramming is to have some process running all the time. 3
  • 4. Why CPU scheduling ? (cont… .) So to implement the concept of multiprogramming we need to design scheduling algorithms. Whenever the CPU becomes idle , the OS must choose one of the process in the ready queue to be executed . The selection process is carried out by a short term scheduler or CPU scheduler . 4
  • 5. 5 Preemptive Vs Non-Preemptive Preemptive Non-Preemptive 1. Allocation For Resource to process for Limited Time. 1. Process holds the resource till Terminated or Switch to Waiting State. 2. Process Can be Interrupted in between 2. Process Can’t be Interrupted until it terminated or switching waiting state 3. High CPU Utilization 3. Low CPU Utilization 4. In Preemptive Scheduling, a running process may be replaced by a higher priority process at any time 4. In Non- Preemptive Scheduling, Once the CPU has been allocated to a process ,the process keeps the CPU it releases the CPU either by terminated by switching the
  • 6. 6 Preemptive Non-Preemptive 5. Preemptive Scheduling is Flexible 5. Preemptive Scheduling is Rigid 6. Preemptive Scheduling is more Complex 6. Non-Preemptive Scheduling is Simple but it is less efficient 7. Preemptive Scheduling is not attractive 7. Non-Preemptive Scheduling is more attractive because of its simplicity 8. Preemptive Scheduling is cost associative 8. Non-Preemptive Scheduling is not cost associative Preemptive Vs Non-Preemptive
  • 7. 7 9.Used in time sharing System 9.Not suitible for time sharing System. 10.Switching Overhead 10.Not Switching Overhead 11.SJF (Shortest Job First ) Scheduling, Round Robin Scheduling 11. FCFS(First come First Serve) Preemptive Vs Non-Preemptive
  • 8. 8 CPU Scheduling Criteria Scheduling Criteria:  There are several different criteria to consider when trying to select the "best" scheduling algorithm for a particular situation and environment, including:  CPU utilization - Ideally the CPU would be busy 100% of the time, so as to waste 0 CPU cycles. On a real system CPU usage should range from 40% ( lightly loaded ) to 90% ( heavily loaded. )  Number of processes completed per unit time. May range from 10 / second to 1 / hour depending on the specific processes.
  • 9. 9  Turnaround time - Time required for a particular process to complete, from submission time to completion. ( Wall clock time. )  Waiting time - How much time processes spend in the ready queue waiting their turn to get on the CPU. ( Load average - The average number of processes sitting in the ready queue waiting their turn to get into the CPU.  Reported in 1-minute, 5-minute, and 15-minute averages by "uptime" and "who". ) Response time - The time taken in an interactive program from the issuance of a command to the commence of a response to that command. CPU Scheduling Criteria
  • 10. 10 In general one wants to optimize the average value of a criteria ( Maximize CPU utilization and throughput, and minimize all the others. ) However some times one wants to do something different, such as to minimize the maximum response time.  Sometimes it is most desirable to minimize the variance of a criteria than the actual value. I.e. users are more accepting of a consistent predictable system than an inconsistent one, even if it is a little bit slower. CPU Scheduling Criteria
  • 11. What is FCFS?  FCFS or First come first serve is an operating system process Scheduling algorithm that automatically executes queued requests and processes by order of their arrival. 5
  • 12. i. Jobs are executed on first come, first serve basis. ii. It is an non-preemptive scheduling algorithm. iii.It’s implementation is based on FIFO queue. iv.OS runs the process at head of the queue. FCFS Basic Concepts 12 Two kinds of non-preemptive FCFS  With priority scheme.  No priority scheme.
  • 13. Advantages 13 i. Simple Algorithm. ii. It is simple to understand and code. iii. Suitable for batch system. i. Because of non-preemptive algorithm the waiting time can be large if short request behind the long process. ii. Not suitable for sharing system. iii. Because of long average waiting time the performance is poor. Disadvantages
  • 14. FCFS CPU Scheduling Algorithm Without Arrival Time 14
  • 15. Process: The processes arrive in the order P1, P2, P3 and are served as per the FCFS algorithm. The Gantt chart is as shown: P1 P2 P3 0 25 29 32 Fig: Gantt Chart
  • 16. 16 Process Burst Time Waiting Time Completion Time Turn Around Time P1 25 0 25 25 P2 4 25 29 29 P3 3 29 32 32  Formula:  Completion Time: Time at which process completes its execution.  Turn Around Time: Turn Around Time = Completion Time – Arrival Time.  Waiting Time(W.T): Waiting Time = Turn Around Time – Burst Time. Average waiting time = (0+25+29)/3 = 18millisecond. Average T.A.T = (25+29+32)/3
  • 17. FCFS CPU Scheduling With Arrival Time 17 Process Arrival Time Burst Time P0 0 2 P1 1 6 P2 2 4 P3 3 9 P4 4 12
  • 18. Process: Process Arrival Time Burst Time P0 0 2 P1 1 6 P2 2 4 P3 3 9 P4 4 12 The processes arrive in the order P1, P2, P3 and P4 are served as per the FCFS algorithm. The Gantt chart is as shown: P0 P1 P2 P3 P4 8 12 21 330 2 Fig: Gantt chart
  • 19. 19 Process Arrival Time Burst Time Completion Time Waiting Time Turn Around Time P0 0 2 2 0 2 P1 1 6 8 1 7 P2 2 4 12 6 10 P3 3 9 21 9 18 P4 4 12 33 17 29  Formula:  Completion Time: Time at which process completes its execution.  Turn Around Time: Turn Around Time = Completion Time – Arrival Time.  Waiting Time(W.T): Waiting Time = Turn Around Time – Burst Time. Average waiting time = (0+1+6+9+17) / 5 = 6.6ms. Average T.A.T = (2+7+10+18+29) / 5