SlideShare une entreprise Scribd logo
1  sur  22
CPU Scheduling Prof.PrasadSawant Lecturer  MCA MACS College Pune Operating System Concepts Prasad Sawant
Alternating Sequence of CPU And I/O Bursts Operating System Concepts Prasad Sawant
CPU Scheduler Selects from among the processes in memory that are ready to execute, and allocates the CPU to one of them. CPU scheduling decisions may take place when a process: 1.	Switches from running to waiting state. 2.	Switches from running to ready state. 3.	Switches from waiting to ready. 4.	Terminates. Scheduling under 1 and 4 is nonpreemptive. All other scheduling is preemptive. Operating System Concepts Prasad Sawant
Dispatcher Dispatcher module gives control of the CPU to the process selected by the short-term scheduler. Operating System Concepts Prasad Sawant
Scheduling Criteria CPU utilization – keep the CPU as busy as possible Throughput– # of processes that complete their execution per time unit Turnaround time – amount of time to execute a particular process Waiting time – amount of time a process has been waiting in the ready queue Operating System Concepts Prasad Sawant
Keep  in mind  Waiting  time (WT)=start time(ST)-Arrival time (AT) Finish time (FT)=start time(ST)+Burst  Time(BT) Total  turn around time(TOT)=Finish time(FT)-Arrival time (AT ) Operating System Concepts Prasad Sawant
Optimization Criteria Max CPU utilization Max throughput Min turnaround time  Min waiting time  Min response time Operating System Concepts Prasad Sawant
First-Come, First-Served (FCFS) Scheduling Operating System Concepts Prasad Sawant Suppose that the processes arrive in the order: P1 , P2 , P3   schedule schedule           0                 10           20                                       30  schedule Waiting time for P1  = 0; P2  = 24; P3 = 27 Average waiting time:  (0 + 24 + 27)/3 = 17 P3  30    P2   27   P1                            24
First-Come, First-Served (FCFS) Scheduling Gantt Chart Operating System Concepts Prasad Sawant Suppose that the processes arrive in the order: P1 , P2 , P3   schedule schedule schedule Waiting time for P1  = 0; P2  = 24; P3 = 27 Average waiting time:  (0 + 24 + 27)/3 = 17 0              P1                                                      24 P2     27 P3     30
Exercise   Find Average waiting time for  Suppose that the processes arrive in the order: P2 , P3 , P1 Operating System Concepts Prasad Sawant
Shortest-Job-First (SJR) Scheduling Associate with each process the length of its next CPU burst.  Use these lengths to schedule the process with the shortest time. Two schemes:  nonpreemptive – once CPU given to the process it cannot be preempted until completes its CPU burst. preemptive – if a new process arrives with CPU burst length less than remaining time of current executing process, preempt.  This scheme is know as the Shortest-Remaining-Time-First (SRTF). SJF is optimal – gives minimum average waiting time for a given set of processes. Operating System Concepts Prasad Sawant
Example of Non-Preemptive SJF Operating System Concepts Prasad Sawant schedule schedule schedule schedule 0    P1                                           7 P3      8 P2      12 P4       16 Average waiting time = (0+6+3+7)/4=4
Example of Non-Preemptive SJF Operating System Concepts Prasad Sawant P1                                           7 P3      8 P2      12 P4       16 Average waiting time = (0+6+3+7)/4=4  Average TOT =(7+10+4+11)/4=8
Preemptive SJF Operating System Concepts Prasad Sawant 7 P schedule 10 10-1=9 schedule 1 1-1=0 schedule 17 17-2=15 schedule 5 5-3=2 0 P1             1 P2                        5          P4               10 P1                  17 P3                 26
Priority Scheduling Operating System Concepts Prasad Sawant Schedule   6 6 Schedule   0 0 Schedule   16 16 Schedule   18 18 Schedule   1 1 41/5=8.2 ms 0      P2         1 P5                          6 P1                                             16 P3             18 P4    19 0
SJF Preemptive  Priority Scheduling  Operating System Concepts Prasad Sawant P 5 scheduled 19 19-3=16 scheduled 24 24-1=23 scheduled 12 12-3=9 scheduled 3 3-3=0 48/4=12 ms 0      P1        3  P4                12   P3          19 P1           24 P2             30
Round Robin  Scheduling   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/nof the CPU time in chunks of at most q time units at once.  No process waits more than (n-1)q time units. Operating System Concepts Prasad Sawant
Time Quantum and Context Switch Time  Operating System Concepts Prasad Sawant 0 0                                          10 1 6           10 9 2 3 4 5 6 7 8 9 10 1
Round Robin  Time  Quantum 4 Operating System Concepts Prasad Sawant 24-4=20 20-4=16 16-4=12 12-4=8 8-4=4 4-4=0 scheduled 30 scheduled 7 scheduled 10 0    P1  4   P2        7   P3        10   P1        14   P1        18   P1        22   P1        26   P1        30
Questions  Define the difference between pre-emptive and non-pre-emptive scheduling.  Explain the concept of a priority used in scheduling. Why is priority working usually chosen for real time processes? Define by difference between preemptive and non-emptive scheduling. Comment on the principle disadvantage of each of these scheduling methods: FCFS, SJF, RR Operating System Concepts Prasad Sawant
Bibliography  Operating System Principle-Peter Galvin Galvin   Prof.S.G.Lakhdive (Dept .Computer Sci ) Prof.Ramkirshna More A.C.S College Akurdi Mr. AbhishekNagar  Web Administrator at Symbiois Operating System Concepts Prasad Sawant
Thanks  you  Operating System Concepts Prasad Sawant

Contenu connexe

Tendances

CPU Scheduling Algorithm (SJF, Round-Robin, Priority)
CPU Scheduling Algorithm (SJF, Round-Robin, Priority)CPU Scheduling Algorithm (SJF, Round-Robin, Priority)
CPU Scheduling Algorithm (SJF, Round-Robin, Priority)Solaiman Hridoy
 
Processor / CPU Scheduling
Processor / CPU SchedulingProcessor / CPU Scheduling
Processor / CPU SchedulingIzaz Roghani
 
Lecture 5, 6 and 7 cpu scheduling
Lecture 5, 6 and 7  cpu schedulingLecture 5, 6 and 7  cpu scheduling
Lecture 5, 6 and 7 cpu schedulingRushdi Shams
 
Scheduling algo(by HJ)
Scheduling algo(by HJ)Scheduling algo(by HJ)
Scheduling algo(by HJ)Harshit Jain
 
Ch6 CPU Scheduling galvin
Ch6 CPU Scheduling galvinCh6 CPU Scheduling galvin
Ch6 CPU Scheduling galvinShubham Singh
 
Process scheduling in Light weight weight and Heavy weight processes.
Process scheduling in Light weight weight and Heavy weight processes.Process scheduling in Light weight weight and Heavy weight processes.
Process scheduling in Light weight weight and Heavy weight processes.Shreya Kumar
 
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 RobinUniversitas Pembangunan Panca Budi
 
CPU Scheduling Algorithms
CPU Scheduling AlgorithmsCPU Scheduling Algorithms
CPU Scheduling AlgorithmsTayba Farooqui
 
CPU Scheduling in OS Presentation
CPU Scheduling in OS  PresentationCPU Scheduling in OS  Presentation
CPU Scheduling in OS Presentationusmankiyani1
 

Tendances (20)

Scheduling
SchedulingScheduling
Scheduling
 
CPU Scheduling Algorithm (SJF, Round-Robin, Priority)
CPU Scheduling Algorithm (SJF, Round-Robin, Priority)CPU Scheduling Algorithm (SJF, Round-Robin, Priority)
CPU Scheduling Algorithm (SJF, Round-Robin, Priority)
 
Processor / CPU Scheduling
Processor / CPU SchedulingProcessor / CPU Scheduling
Processor / CPU Scheduling
 
Ch05
Ch05Ch05
Ch05
 
Lecture 5, 6 and 7 cpu scheduling
Lecture 5, 6 and 7  cpu schedulingLecture 5, 6 and 7  cpu scheduling
Lecture 5, 6 and 7 cpu scheduling
 
Scheduling algo(by HJ)
Scheduling algo(by HJ)Scheduling algo(by HJ)
Scheduling algo(by HJ)
 
Ch6 CPU Scheduling galvin
Ch6 CPU Scheduling galvinCh6 CPU Scheduling galvin
Ch6 CPU Scheduling galvin
 
5 Process Scheduling
5 Process Scheduling5 Process Scheduling
5 Process Scheduling
 
Cpu Scheduling Galvin
Cpu Scheduling GalvinCpu Scheduling Galvin
Cpu Scheduling Galvin
 
Chapter6
Chapter6Chapter6
Chapter6
 
Scheduling Algorithms
Scheduling AlgorithmsScheduling Algorithms
Scheduling Algorithms
 
OSCh6
OSCh6OSCh6
OSCh6
 
CPU Scheduling Algorithms
CPU Scheduling AlgorithmsCPU Scheduling Algorithms
CPU Scheduling Algorithms
 
Process scheduling in Light weight weight and Heavy weight processes.
Process scheduling in Light weight weight and Heavy weight processes.Process scheduling in Light weight weight and Heavy weight processes.
Process scheduling in Light weight weight and Heavy weight processes.
 
Sa by shekhar
Sa by shekharSa by shekhar
Sa by shekhar
 
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
 
Cpu scheduling
Cpu schedulingCpu scheduling
Cpu scheduling
 
CPU Scheduling Algorithms
CPU Scheduling AlgorithmsCPU Scheduling Algorithms
CPU Scheduling Algorithms
 
Process Scheduling
Process SchedulingProcess Scheduling
Process Scheduling
 
CPU Scheduling in OS Presentation
CPU Scheduling in OS  PresentationCPU Scheduling in OS  Presentation
CPU Scheduling in OS Presentation
 

En vedette

Cpu scheduling algorithms simulation using java
Cpu scheduling algorithms simulation using javaCpu scheduling algorithms simulation using java
Cpu scheduling algorithms simulation using javajsivasrinivas
 
Multiprocessor scheduling 1
Multiprocessor scheduling 1Multiprocessor scheduling 1
Multiprocessor scheduling 1mrbourne
 
Operating system concepts
Operating system conceptsOperating system concepts
Operating system conceptsStarlee Lathong
 
Ch2: Computer System Structure (OS)
Ch2: Computer System Structure (OS)Ch2: Computer System Structure (OS)
Ch2: Computer System Structure (OS)Ahmar Hashmi
 
Multiprocessor scheduling 2
Multiprocessor scheduling 2Multiprocessor scheduling 2
Multiprocessor scheduling 2mrbourne
 
Multiprocessor Scheduling
Multiprocessor SchedulingMultiprocessor Scheduling
Multiprocessor SchedulingKhadija Saleem
 
COMBINATIONAL CIRCUITS & FLIP FLOPS
COMBINATIONAL CIRCUITS & FLIP FLOPSCOMBINATIONAL CIRCUITS & FLIP FLOPS
COMBINATIONAL CIRCUITS & FLIP FLOPSStarlee Lathong
 
Real-Time Scheduling Algorithms
Real-Time Scheduling AlgorithmsReal-Time Scheduling Algorithms
Real-Time Scheduling AlgorithmsAJAL A J
 
CPU scheduling algorithms in OS
CPU scheduling algorithms in OSCPU scheduling algorithms in OS
CPU scheduling algorithms in OSharini0810
 
Slides For Operating System Concepts By Silberschatz Galvin And Gagne
Slides For Operating System Concepts By Silberschatz Galvin And GagneSlides For Operating System Concepts By Silberschatz Galvin And Gagne
Slides For Operating System Concepts By Silberschatz Galvin And Gagnesarankumar4445
 
LinkedIn SlideShare: Knowledge, Well-Presented
LinkedIn SlideShare: Knowledge, Well-PresentedLinkedIn SlideShare: Knowledge, Well-Presented
LinkedIn SlideShare: Knowledge, Well-PresentedSlideShare
 

En vedette (16)

Akash
AkashAkash
Akash
 
Cpu scheduling algorithms simulation using java
Cpu scheduling algorithms simulation using javaCpu scheduling algorithms simulation using java
Cpu scheduling algorithms simulation using java
 
Cpu scheduling
Cpu schedulingCpu scheduling
Cpu scheduling
 
Multiprocessor scheduling 1
Multiprocessor scheduling 1Multiprocessor scheduling 1
Multiprocessor scheduling 1
 
Unit 2 notes
Unit 2 notesUnit 2 notes
Unit 2 notes
 
Operating system concepts
Operating system conceptsOperating system concepts
Operating system concepts
 
Ch2: Computer System Structure (OS)
Ch2: Computer System Structure (OS)Ch2: Computer System Structure (OS)
Ch2: Computer System Structure (OS)
 
Multiprocessor scheduling 2
Multiprocessor scheduling 2Multiprocessor scheduling 2
Multiprocessor scheduling 2
 
Multiprocessor Scheduling
Multiprocessor SchedulingMultiprocessor Scheduling
Multiprocessor Scheduling
 
COMBINATIONAL CIRCUITS & FLIP FLOPS
COMBINATIONAL CIRCUITS & FLIP FLOPSCOMBINATIONAL CIRCUITS & FLIP FLOPS
COMBINATIONAL CIRCUITS & FLIP FLOPS
 
Cpu scheduling
Cpu schedulingCpu scheduling
Cpu scheduling
 
Real-Time Scheduling Algorithms
Real-Time Scheduling AlgorithmsReal-Time Scheduling Algorithms
Real-Time Scheduling Algorithms
 
Types of operating system
Types of operating systemTypes of operating system
Types of operating system
 
CPU scheduling algorithms in OS
CPU scheduling algorithms in OSCPU scheduling algorithms in OS
CPU scheduling algorithms in OS
 
Slides For Operating System Concepts By Silberschatz Galvin And Gagne
Slides For Operating System Concepts By Silberschatz Galvin And GagneSlides For Operating System Concepts By Silberschatz Galvin And Gagne
Slides For Operating System Concepts By Silberschatz Galvin And Gagne
 
LinkedIn SlideShare: Knowledge, Well-Presented
LinkedIn SlideShare: Knowledge, Well-PresentedLinkedIn SlideShare: Knowledge, Well-Presented
LinkedIn SlideShare: Knowledge, Well-Presented
 

Similaire à CPU Sheduling

Operating System 5
Operating System 5Operating System 5
Operating System 5tech2click
 
Ch6
Ch6Ch6
Ch6C.U
 
Process management in os
Process management in osProcess management in os
Process management in osMiong Lazaro
 
SCHEDULING ALGORITHMS
SCHEDULING ALGORITHMSSCHEDULING ALGORITHMS
SCHEDULING ALGORITHMSMargrat C R
 
Scheduling algorithm (chammu)
Scheduling algorithm (chammu)Scheduling algorithm (chammu)
Scheduling algorithm (chammu)Nagarajan
 
Csc4320 chapter 5 2
Csc4320 chapter 5 2Csc4320 chapter 5 2
Csc4320 chapter 5 2pri534
 
cpu sechduling
cpu sechduling cpu sechduling
cpu sechduling gopi7
 
Operating system 29 non preemptive scheduling
Operating system 29 non preemptive schedulingOperating system 29 non preemptive scheduling
Operating system 29 non preemptive schedulingVaibhav Khanna
 
Cpu scheduling(suresh)
Cpu scheduling(suresh)Cpu scheduling(suresh)
Cpu scheduling(suresh)Nagarajan
 
Operating System Scheduling
Operating System SchedulingOperating System Scheduling
Operating System SchedulingVishnu Prasad
 
Cpu scheduling in operating System.
Cpu scheduling in operating System.Cpu scheduling in operating System.
Cpu scheduling in operating System.Ravi Kumar Patel
 
AlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorit...
AlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorit...AlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorit...
AlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorit...Shanmuganathan C
 
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
 
csc4320chapter5-2-101203002830-phpapp01.pdf
csc4320chapter5-2-101203002830-phpapp01.pdfcsc4320chapter5-2-101203002830-phpapp01.pdf
csc4320chapter5-2-101203002830-phpapp01.pdfAkarshNag
 

Similaire à CPU Sheduling (20)

Operating System 5
Operating System 5Operating System 5
Operating System 5
 
Ch6
Ch6Ch6
Ch6
 
OS_Ch6
OS_Ch6OS_Ch6
OS_Ch6
 
Ch5
Ch5Ch5
Ch5
 
Process management in os
Process management in osProcess management in os
Process management in os
 
SCHEDULING ALGORITHMS
SCHEDULING ALGORITHMSSCHEDULING ALGORITHMS
SCHEDULING ALGORITHMS
 
Operating System Sheduling
Operating System ShedulingOperating System Sheduling
Operating System Sheduling
 
Scheduling algorithm (chammu)
Scheduling algorithm (chammu)Scheduling algorithm (chammu)
Scheduling algorithm (chammu)
 
CH06.pdf
CH06.pdfCH06.pdf
CH06.pdf
 
Csc4320 chapter 5 2
Csc4320 chapter 5 2Csc4320 chapter 5 2
Csc4320 chapter 5 2
 
Scheduling algorithms
Scheduling algorithmsScheduling algorithms
Scheduling algorithms
 
Os..
Os..Os..
Os..
 
cpu sechduling
cpu sechduling cpu sechduling
cpu sechduling
 
Operating system 29 non preemptive scheduling
Operating system 29 non preemptive schedulingOperating system 29 non preemptive scheduling
Operating system 29 non preemptive scheduling
 
Cpu scheduling(suresh)
Cpu scheduling(suresh)Cpu scheduling(suresh)
Cpu scheduling(suresh)
 
Operating System Scheduling
Operating System SchedulingOperating System Scheduling
Operating System Scheduling
 
Cpu scheduling in operating System.
Cpu scheduling in operating System.Cpu scheduling in operating System.
Cpu scheduling in operating System.
 
AlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorit...
AlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorit...AlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorit...
AlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorit...
 
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
 
csc4320chapter5-2-101203002830-phpapp01.pdf
csc4320chapter5-2-101203002830-phpapp01.pdfcsc4320chapter5-2-101203002830-phpapp01.pdf
csc4320chapter5-2-101203002830-phpapp01.pdf
 

Dernier

Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 

Dernier (20)

Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 

CPU Sheduling

  • 1. CPU Scheduling Prof.PrasadSawant Lecturer MCA MACS College Pune Operating System Concepts Prasad Sawant
  • 2. Alternating Sequence of CPU And I/O Bursts Operating System Concepts Prasad Sawant
  • 3. CPU Scheduler Selects from among the processes in memory that are ready to execute, and allocates the CPU to one of them. CPU scheduling decisions may take place when a process: 1. Switches from running to waiting state. 2. Switches from running to ready state. 3. Switches from waiting to ready. 4. Terminates. Scheduling under 1 and 4 is nonpreemptive. All other scheduling is preemptive. Operating System Concepts Prasad Sawant
  • 4. Dispatcher Dispatcher module gives control of the CPU to the process selected by the short-term scheduler. Operating System Concepts Prasad Sawant
  • 5. Scheduling Criteria CPU utilization – keep the CPU as busy as possible Throughput– # of processes that complete their execution per time unit Turnaround time – amount of time to execute a particular process Waiting time – amount of time a process has been waiting in the ready queue Operating System Concepts Prasad Sawant
  • 6. Keep in mind Waiting time (WT)=start time(ST)-Arrival time (AT) Finish time (FT)=start time(ST)+Burst Time(BT) Total turn around time(TOT)=Finish time(FT)-Arrival time (AT ) Operating System Concepts Prasad Sawant
  • 7. Optimization Criteria Max CPU utilization Max throughput Min turnaround time Min waiting time Min response time Operating System Concepts Prasad Sawant
  • 8. First-Come, First-Served (FCFS) Scheduling Operating System Concepts Prasad Sawant Suppose that the processes arrive in the order: P1 , P2 , P3 schedule schedule 0 10 20 30 schedule Waiting time for P1 = 0; P2 = 24; P3 = 27 Average waiting time: (0 + 24 + 27)/3 = 17 P3 30 P2 27 P1 24
  • 9. First-Come, First-Served (FCFS) Scheduling Gantt Chart Operating System Concepts Prasad Sawant Suppose that the processes arrive in the order: P1 , P2 , P3 schedule schedule schedule Waiting time for P1 = 0; P2 = 24; P3 = 27 Average waiting time: (0 + 24 + 27)/3 = 17 0 P1 24 P2 27 P3 30
  • 10. Exercise Find Average waiting time for Suppose that the processes arrive in the order: P2 , P3 , P1 Operating System Concepts Prasad Sawant
  • 11. Shortest-Job-First (SJR) Scheduling Associate with each process the length of its next CPU burst. Use these lengths to schedule the process with the shortest time. Two schemes: nonpreemptive – once CPU given to the process it cannot be preempted until completes its CPU burst. preemptive – if a new process arrives with CPU burst length less than remaining time of current executing process, preempt. This scheme is know as the Shortest-Remaining-Time-First (SRTF). SJF is optimal – gives minimum average waiting time for a given set of processes. Operating System Concepts Prasad Sawant
  • 12. Example of Non-Preemptive SJF Operating System Concepts Prasad Sawant schedule schedule schedule schedule 0 P1 7 P3 8 P2 12 P4 16 Average waiting time = (0+6+3+7)/4=4
  • 13. Example of Non-Preemptive SJF Operating System Concepts Prasad Sawant P1 7 P3 8 P2 12 P4 16 Average waiting time = (0+6+3+7)/4=4 Average TOT =(7+10+4+11)/4=8
  • 14. Preemptive SJF Operating System Concepts Prasad Sawant 7 P schedule 10 10-1=9 schedule 1 1-1=0 schedule 17 17-2=15 schedule 5 5-3=2 0 P1 1 P2 5 P4 10 P1 17 P3 26
  • 15. Priority Scheduling Operating System Concepts Prasad Sawant Schedule 6 6 Schedule 0 0 Schedule 16 16 Schedule 18 18 Schedule 1 1 41/5=8.2 ms 0 P2 1 P5 6 P1 16 P3 18 P4 19 0
  • 16. SJF Preemptive Priority Scheduling Operating System Concepts Prasad Sawant P 5 scheduled 19 19-3=16 scheduled 24 24-1=23 scheduled 12 12-3=9 scheduled 3 3-3=0 48/4=12 ms 0 P1 3 P4 12 P3 19 P1 24 P2 30
  • 17. Round Robin Scheduling 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/nof the CPU time in chunks of at most q time units at once. No process waits more than (n-1)q time units. Operating System Concepts Prasad Sawant
  • 18. Time Quantum and Context Switch Time Operating System Concepts Prasad Sawant 0 0 10 1 6 10 9 2 3 4 5 6 7 8 9 10 1
  • 19. Round Robin Time Quantum 4 Operating System Concepts Prasad Sawant 24-4=20 20-4=16 16-4=12 12-4=8 8-4=4 4-4=0 scheduled 30 scheduled 7 scheduled 10 0 P1 4 P2 7 P3 10 P1 14 P1 18 P1 22 P1 26 P1 30
  • 20. Questions Define the difference between pre-emptive and non-pre-emptive scheduling. Explain the concept of a priority used in scheduling. Why is priority working usually chosen for real time processes? Define by difference between preemptive and non-emptive scheduling. Comment on the principle disadvantage of each of these scheduling methods: FCFS, SJF, RR Operating System Concepts Prasad Sawant
  • 21. Bibliography Operating System Principle-Peter Galvin Galvin Prof.S.G.Lakhdive (Dept .Computer Sci ) Prof.Ramkirshna More A.C.S College Akurdi Mr. AbhishekNagar Web Administrator at Symbiois Operating System Concepts Prasad Sawant
  • 22. Thanks you Operating System Concepts Prasad Sawant