SlideShare a Scribd company logo
Welcome
to Our
Presentation
Priority
Scheduling
Algorithms
2
Submitted by-
Name ID
Asikul Islam 143-15-
Kanchon Kumar 143-15-
Saiful Islam 143-15-
Sonot Kumar 143-15-
Sohel Al Mamun 143-15-
Tuhinur Rahman 143-15-
Muine al Yamine
Submitted to-
Dept. Of CSE
Overview 4
 Basic Concepts
 Scheduling Criteria
 Scheduling Algorithms
 Example of Priority Scheduling
 Advantages & Disadvantages
Basic Concepts
 Main objective of multiprogramming is to keep on
running processes all the time for maximum CPU
utilization.
 Scheduling is fundamental function of OS.
 The task of selecting the processes in memory that are
ready to execute, and allocating them to the CPU is
performed by the CPU Scheduler.
5
CPU Scheduler
 CPU scheduling decisions may take place when
a process:
o 1. Switches from running to waiting state
o 2. Switches from running to ready state
o 3. Switches from waiting to ready
o 4. Terminates
 Scheduling under 1 and 4 is non preemptive.
 All other scheduling is preemptive.
6
CPU Scheduler
 Nonpreemptive
Once a process is allocated the CPU, it does
not leave unless:
o it has to wait, e.g., for I/O request 
o it terminates  
 Preemptive
o OS can force (preempt) a process from CPU at anytime
o E.g., to allocate CPU to another higher-priority process 
7
CONT…
Scheduling Criteria
 CPU utilization: keep the CPU as busy as possible
◦ Maximize
 Throughput: No of processes that complete their
execution per time unit
◦ Maximize
 Turnaround time: amount of time to execute a
particular process (time from submission to
termination)
◦ Minimize
8
Scheduling Criteria 9
CONT…
 Waiting time: amount of time a process has been
waiting in the ready queue (sum of time waiting in
ready queue)
o Minimize
 Response time – amount of time it takes from when
a request was submitted until the first response is
produced, not output  (for time-sharing
environment)
o Minimize
Scheduling Algorithms
 First Come, First Served
 Shortest Job First
 Priority
 Round Robin
10
 A priority number (integer) is associated with each
process.
 Lager the CPU burst lower the priority.
 The CPU is allocated to the process with the highest
priority (smallest integer ≡ highest priority)
 Starvation (Infinity blocking): low priority processes
may never execute.
 Aging: as time progresses increase the priority of the
process.
Priority 11
CONT…
Example of Priority Scheduling (Non-
Preemptive) 12
Process Burst Time Priority
P1 10 3
P2 1 1
P3 2 4
P4 1 5
P5 5 2
 Gantt Chart
 Average waiting time = (6 + 0 + 16 + 18 + 1)/5 = 8.2
 Average Turn Around Time= (1+6+16+18+19)/5 = 12
P2 P1P5
61 160
P3
18
P4
19
Example of Priority Scheduling
(Preemptive)
Process Arrival Time Burst Time Priority
P1 0 5 2
P2 4 8 1
P3 6 2 4 p4
8 6 3
Average WT: ([(0-0)+(12-4)]+(4-4)+(19-6)+(13-8))/4
= (8+0+13+5)/4 = 6.5
Average TAT: ((5+8)+(8+0)+(2+13)+(6+5))/4
= (13+8+15+11)/4 = 47/4 = 11.75
P1
P4P2
4 190 13
P3
2112
P1
Advantages of Priority
 Easy to use
 User friendly
 Aging :- As time increases , increase in the priority
of a process .
 Simplicity .
 Suiteble for aplications with varying time and
resource requirement .
Disadvantages of Priority
 If system eventually crashes , all low priority
processes get lost .
 Indefinite blocking or Starvation .
Preemptive vs nonpreemptive
schedulingCPU scheduling decisions may take place when a process:
1. switches from running to waiting state
e.g., I/O request
2. switches from running to ready state
e.g., when interrupt or timeout occurs
3. switches from waiting to ready
e.g., completion of I/O
4. Terminates
scheduling under 1 and 4 is nonpreemptive
 once a process starts, it runs until it terminates or willingly gives up control
simple and efficient to implement – few context switches
examples: Windows 3.1, early Mac OS
all other scheduling is preemptive
 process can be "forced" to give up the CPU (e.g., timeout, higher priority process)
more sophisticated and powerful
examples: Windows 95/98/NT/2K, Mac OS-X, UNIX
 Preemptive vs Non-Preemptive Scheduling
 Scheduling is non-preemptive if once the CPU has been allocated
to a process, the process can keep the CPU until it releases it,
either by terminating or switching to the waiting state.
 Scheduling is preemptive if the CPU can be taken away from a
process during execution.
Priority scheduling
each process is assigned a numeric priority
 CPU is allocated to the process with the highest priority
 priorities can be external (set by user/admin) or internal
 (based on resources/history)
 SJF is priority scheduling where priority is the predicted
 next CPU burst time
priority scheduling may be preemptive or nonpreemptive
 priority scheduling is not fair
 starvation is possible – low priority processes may never execute
 can be made fair using aging – as time progresses, increase the
priority
 Aging is a technique of gradually increasing the priority of
processes that wait in the system for a long time
Priority scheduling algorithms

More Related Content

What's hot

CPU Scheduling Algorithms
CPU Scheduling AlgorithmsCPU Scheduling Algorithms
CPU Scheduling Algorithms
Shubhashish Punj
 
OS - Process Concepts
OS - Process ConceptsOS - Process Concepts
OS - Process Concepts
Mukesh Chinta
 
Critical section problem in operating system.
Critical section problem in operating system.Critical section problem in operating system.
Critical section problem in operating system.
MOHIT DADU
 
Shortest job first Scheduling (SJF)
Shortest job first Scheduling (SJF)Shortest job first Scheduling (SJF)
Shortest job first Scheduling (SJF)
ritu98
 
Operating system critical section
Operating system   critical sectionOperating system   critical section
Operating system critical section
Harshana Madusanka Jayamaha
 
DeadLock in Operating-Systems
DeadLock in Operating-SystemsDeadLock in Operating-Systems
DeadLock in Operating-Systems
Venkata Sreeram
 
Process scheduling (CPU Scheduling)
Process scheduling (CPU Scheduling)Process scheduling (CPU Scheduling)
Process scheduling (CPU Scheduling)
Mukesh Chinta
 
System calls
System callsSystem calls
System calls
Bernard Senam
 
INTER PROCESS COMMUNICATION (IPC).pptx
INTER PROCESS COMMUNICATION (IPC).pptxINTER PROCESS COMMUNICATION (IPC).pptx
INTER PROCESS COMMUNICATION (IPC).pptx
LECO9
 
Context switching
Context switchingContext switching
Context switching
DarakhshanNayyab
 
Inter Process Communication Presentation[1]
Inter Process Communication Presentation[1]Inter Process Communication Presentation[1]
Inter Process Communication Presentation[1]Ravindra Raju Kolahalam
 
Linux process management
Linux process managementLinux process management
Linux process managementRaghu nath
 
Instruction codes
Instruction codesInstruction codes
Instruction codes
pradeepa velmurugan
 
Peterson Critical Section Problem Solution
Peterson Critical Section Problem SolutionPeterson Critical Section Problem Solution
Peterson Critical Section Problem Solution
Bipul Chandra Kar
 
Process state in OS
Process state in OSProcess state in OS
Process state in OS
Khushboo Jain
 
Deadlock Avoidance in Operating System
Deadlock Avoidance in Operating SystemDeadlock Avoidance in Operating System
Deadlock Avoidance in Operating System
Mohammad Hafiz-Al-Masud
 
Threads (operating System)
Threads (operating System)Threads (operating System)
Threads (operating System)
Prakhar Maurya
 
Process in operating system
Process in operating systemProcess in operating system
Process in operating system
Chetan Mahawar
 

What's hot (20)

CPU Scheduling Algorithms
CPU Scheduling AlgorithmsCPU Scheduling Algorithms
CPU Scheduling Algorithms
 
OS - Process Concepts
OS - Process ConceptsOS - Process Concepts
OS - Process Concepts
 
Critical section problem in operating system.
Critical section problem in operating system.Critical section problem in operating system.
Critical section problem in operating system.
 
Shortest job first Scheduling (SJF)
Shortest job first Scheduling (SJF)Shortest job first Scheduling (SJF)
Shortest job first Scheduling (SJF)
 
Semaphores
SemaphoresSemaphores
Semaphores
 
Operating system critical section
Operating system   critical sectionOperating system   critical section
Operating system critical section
 
DeadLock in Operating-Systems
DeadLock in Operating-SystemsDeadLock in Operating-Systems
DeadLock in Operating-Systems
 
Process scheduling (CPU Scheduling)
Process scheduling (CPU Scheduling)Process scheduling (CPU Scheduling)
Process scheduling (CPU Scheduling)
 
System calls
System callsSystem calls
System calls
 
INTER PROCESS COMMUNICATION (IPC).pptx
INTER PROCESS COMMUNICATION (IPC).pptxINTER PROCESS COMMUNICATION (IPC).pptx
INTER PROCESS COMMUNICATION (IPC).pptx
 
Context switching
Context switchingContext switching
Context switching
 
Inter Process Communication Presentation[1]
Inter Process Communication Presentation[1]Inter Process Communication Presentation[1]
Inter Process Communication Presentation[1]
 
Linux process management
Linux process managementLinux process management
Linux process management
 
Instruction codes
Instruction codesInstruction codes
Instruction codes
 
Memory management
Memory managementMemory management
Memory management
 
Peterson Critical Section Problem Solution
Peterson Critical Section Problem SolutionPeterson Critical Section Problem Solution
Peterson Critical Section Problem Solution
 
Process state in OS
Process state in OSProcess state in OS
Process state in OS
 
Deadlock Avoidance in Operating System
Deadlock Avoidance in Operating SystemDeadlock Avoidance in Operating System
Deadlock Avoidance in Operating System
 
Threads (operating System)
Threads (operating System)Threads (operating System)
Threads (operating System)
 
Process in operating system
Process in operating systemProcess in operating system
Process in operating system
 

Similar to Priority scheduling algorithms

CPU Scheduling algorithms
CPU Scheduling algorithmsCPU Scheduling algorithms
CPU Scheduling algorithms
Shanu Kumar
 
CPU Scheduling
CPU SchedulingCPU Scheduling
CPU Scheduling
sammerkhan1
 
CPU SCHEDULING IN OPERATING SYSTEMS IN DETAILED
CPU SCHEDULING IN OPERATING SYSTEMS IN DETAILEDCPU SCHEDULING IN OPERATING SYSTEMS IN DETAILED
CPU SCHEDULING IN OPERATING SYSTEMS IN DETAILED
VADAPALLYPRAVEENKUMA1
 
Operating System Scheduling
Operating System SchedulingOperating System Scheduling
Operating System Scheduling
Vishnu Prasad
 
CPU scheduling
CPU schedulingCPU scheduling
CPU scheduling
Amir Khan
 
Scheduling algo(by HJ)
Scheduling algo(by HJ)Scheduling algo(by HJ)
Scheduling algo(by HJ)
Harshit Jain
 
CPU Scheduling
CPU SchedulingCPU Scheduling
CPU Scheduling
M. Abdullah Wasif
 
cpu schduling ppt.pdf
cpu schduling ppt.pdfcpu schduling ppt.pdf
cpu schduling ppt.pdf
SangeethaBS4
 
Preemptive process example.pptx
Preemptive process example.pptxPreemptive process example.pptx
Preemptive process example.pptx
jamilaltiti1
 
Window scheduling algorithm
Window scheduling algorithmWindow scheduling algorithm
Window scheduling algorithm
Binal Parekh
 
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
 
Fcfs and sjf
Fcfs and sjfFcfs and sjf
Fcfs and sjf
A. S. M. Shafi
 
chapter 5 CPU scheduling.ppt
chapter  5 CPU scheduling.pptchapter  5 CPU scheduling.ppt
chapter 5 CPU scheduling.ppt
KeyreSebre
 
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
 
Ch05 cpu-scheduling
Ch05 cpu-schedulingCh05 cpu-scheduling
Ch05 cpu-scheduling
Nazir Ahmed
 
Operating System-Process Scheduling
Operating System-Process SchedulingOperating System-Process Scheduling
Operating System-Process Scheduling
Shipra Swati
 

Similar to Priority scheduling algorithms (20)

CPU Scheduling algorithms
CPU Scheduling algorithmsCPU Scheduling algorithms
CPU Scheduling algorithms
 
CPU Scheduling
CPU SchedulingCPU Scheduling
CPU Scheduling
 
Cpu Scheduling Galvin
Cpu Scheduling GalvinCpu Scheduling Galvin
Cpu Scheduling Galvin
 
CPU SCHEDULING IN OPERATING SYSTEMS IN DETAILED
CPU SCHEDULING IN OPERATING SYSTEMS IN DETAILEDCPU SCHEDULING IN OPERATING SYSTEMS IN DETAILED
CPU SCHEDULING IN OPERATING SYSTEMS IN DETAILED
 
Operating System Scheduling
Operating System SchedulingOperating System Scheduling
Operating System Scheduling
 
CPU scheduling
CPU schedulingCPU scheduling
CPU scheduling
 
Scheduling algo(by HJ)
Scheduling algo(by HJ)Scheduling algo(by HJ)
Scheduling algo(by HJ)
 
CPU Scheduling
CPU SchedulingCPU Scheduling
CPU Scheduling
 
Scheduling
SchedulingScheduling
Scheduling
 
cpu schduling ppt.pdf
cpu schduling ppt.pdfcpu schduling ppt.pdf
cpu schduling ppt.pdf
 
Preemptive process example.pptx
Preemptive process example.pptxPreemptive process example.pptx
Preemptive process example.pptx
 
Window scheduling algorithm
Window scheduling algorithmWindow scheduling algorithm
Window scheduling algorithm
 
Unit 2 notes
Unit 2 notesUnit 2 notes
Unit 2 notes
 
OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...
 
Cp usched 2
Cp usched  2Cp usched  2
Cp usched 2
 
Fcfs and sjf
Fcfs and sjfFcfs and sjf
Fcfs and sjf
 
chapter 5 CPU scheduling.ppt
chapter  5 CPU scheduling.pptchapter  5 CPU scheduling.ppt
chapter 5 CPU scheduling.ppt
 
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
 
Ch05 cpu-scheduling
Ch05 cpu-schedulingCh05 cpu-scheduling
Ch05 cpu-scheduling
 
Operating System-Process Scheduling
Operating System-Process SchedulingOperating System-Process Scheduling
Operating System-Process Scheduling
 

More from Daffodil International University

Computer graphics
Computer graphicsComputer graphics
OpenGL Mini Projects With Source Code [ Computer Graphics ]
OpenGL Mini Projects With Source Code [ Computer Graphics ]OpenGL Mini Projects With Source Code [ Computer Graphics ]
OpenGL Mini Projects With Source Code [ Computer Graphics ]
Daffodil International University
 
Web engineering / web design & development
Web engineering / web design & development Web engineering / web design & development
Web engineering / web design & development
Daffodil International University
 
Ibm watson
Ibm watsonIbm watson
ATM System management
ATM System managementATM System management
ATM System management
Daffodil International University
 
Analysis and design of information system
Analysis and design of information systemAnalysis and design of information system
Analysis and design of information system
Daffodil International University
 
Basic computer architecture
Basic computer architectureBasic computer architecture
Basic computer architecture
Daffodil International University
 

More from Daffodil International University (8)

Computer graphics
Computer graphicsComputer graphics
Computer graphics
 
Data mining
Data miningData mining
Data mining
 
OpenGL Mini Projects With Source Code [ Computer Graphics ]
OpenGL Mini Projects With Source Code [ Computer Graphics ]OpenGL Mini Projects With Source Code [ Computer Graphics ]
OpenGL Mini Projects With Source Code [ Computer Graphics ]
 
Web engineering / web design & development
Web engineering / web design & development Web engineering / web design & development
Web engineering / web design & development
 
Ibm watson
Ibm watsonIbm watson
Ibm watson
 
ATM System management
ATM System managementATM System management
ATM System management
 
Analysis and design of information system
Analysis and design of information systemAnalysis and design of information system
Analysis and design of information system
 
Basic computer architecture
Basic computer architectureBasic computer architecture
Basic computer architecture
 

Recently uploaded

Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
Cambridge International AS A Level Biology Coursebook - EBook (MaryFosbery J...
Cambridge International AS  A Level Biology Coursebook - EBook (MaryFosbery J...Cambridge International AS  A Level Biology Coursebook - EBook (MaryFosbery J...
Cambridge International AS A Level Biology Coursebook - EBook (MaryFosbery J...
AzmatAli747758
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 
Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
Excellence Foundation for South Sudan
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
Jheel Barad
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
PART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePART A. Introduction to Costumer Service
PART A. Introduction to Costumer Service
PedroFerreira53928
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)
rosedainty
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
MIRIAMSALINAS13
 
Ethnobotany and Ethnopharmacology ......
Ethnobotany and Ethnopharmacology ......Ethnobotany and Ethnopharmacology ......
Ethnobotany and Ethnopharmacology ......
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
beazzy04
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
kaushalkr1407
 

Recently uploaded (20)

Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
Cambridge International AS A Level Biology Coursebook - EBook (MaryFosbery J...
Cambridge International AS  A Level Biology Coursebook - EBook (MaryFosbery J...Cambridge International AS  A Level Biology Coursebook - EBook (MaryFosbery J...
Cambridge International AS A Level Biology Coursebook - EBook (MaryFosbery J...
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
PART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePART A. Introduction to Costumer Service
PART A. Introduction to Costumer Service
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
Ethnobotany and Ethnopharmacology ......
Ethnobotany and Ethnopharmacology ......Ethnobotany and Ethnopharmacology ......
Ethnobotany and Ethnopharmacology ......
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
 

Priority scheduling algorithms

  • 3. Submitted by- Name ID Asikul Islam 143-15- Kanchon Kumar 143-15- Saiful Islam 143-15- Sonot Kumar 143-15- Sohel Al Mamun 143-15- Tuhinur Rahman 143-15- Muine al Yamine Submitted to- Dept. Of CSE
  • 4. Overview 4  Basic Concepts  Scheduling Criteria  Scheduling Algorithms  Example of Priority Scheduling  Advantages & Disadvantages
  • 5. Basic Concepts  Main objective of multiprogramming is to keep on running processes all the time for maximum CPU utilization.  Scheduling is fundamental function of OS.  The task of selecting the processes in memory that are ready to execute, and allocating them to the CPU is performed by the CPU Scheduler. 5
  • 6. CPU Scheduler  CPU scheduling decisions may take place when a process: o 1. Switches from running to waiting state o 2. Switches from running to ready state o 3. Switches from waiting to ready o 4. Terminates  Scheduling under 1 and 4 is non preemptive.  All other scheduling is preemptive. 6
  • 7. CPU Scheduler  Nonpreemptive Once a process is allocated the CPU, it does not leave unless: o it has to wait, e.g., for I/O request  o it terminates    Preemptive o OS can force (preempt) a process from CPU at anytime o E.g., to allocate CPU to another higher-priority process  7 CONT…
  • 8. Scheduling Criteria  CPU utilization: keep the CPU as busy as possible ◦ Maximize  Throughput: No of processes that complete their execution per time unit ◦ Maximize  Turnaround time: amount of time to execute a particular process (time from submission to termination) ◦ Minimize 8
  • 9. Scheduling Criteria 9 CONT…  Waiting time: amount of time a process has been waiting in the ready queue (sum of time waiting in ready queue) o Minimize  Response time – amount of time it takes from when a request was submitted until the first response is produced, not output  (for time-sharing environment) o Minimize
  • 10. Scheduling Algorithms  First Come, First Served  Shortest Job First  Priority  Round Robin 10
  • 11.  A priority number (integer) is associated with each process.  Lager the CPU burst lower the priority.  The CPU is allocated to the process with the highest priority (smallest integer ≡ highest priority)  Starvation (Infinity blocking): low priority processes may never execute.  Aging: as time progresses increase the priority of the process. Priority 11 CONT…
  • 12. Example of Priority Scheduling (Non- Preemptive) 12 Process Burst Time Priority P1 10 3 P2 1 1 P3 2 4 P4 1 5 P5 5 2  Gantt Chart  Average waiting time = (6 + 0 + 16 + 18 + 1)/5 = 8.2  Average Turn Around Time= (1+6+16+18+19)/5 = 12 P2 P1P5 61 160 P3 18 P4 19
  • 13. Example of Priority Scheduling (Preemptive) Process Arrival Time Burst Time Priority P1 0 5 2 P2 4 8 1 P3 6 2 4 p4 8 6 3 Average WT: ([(0-0)+(12-4)]+(4-4)+(19-6)+(13-8))/4 = (8+0+13+5)/4 = 6.5 Average TAT: ((5+8)+(8+0)+(2+13)+(6+5))/4 = (13+8+15+11)/4 = 47/4 = 11.75 P1 P4P2 4 190 13 P3 2112 P1
  • 14. Advantages of Priority  Easy to use  User friendly  Aging :- As time increases , increase in the priority of a process .  Simplicity .  Suiteble for aplications with varying time and resource requirement .
  • 15. Disadvantages of Priority  If system eventually crashes , all low priority processes get lost .  Indefinite blocking or Starvation .
  • 16. Preemptive vs nonpreemptive schedulingCPU scheduling decisions may take place when a process: 1. switches from running to waiting state e.g., I/O request 2. switches from running to ready state e.g., when interrupt or timeout occurs 3. switches from waiting to ready e.g., completion of I/O 4. Terminates scheduling under 1 and 4 is nonpreemptive  once a process starts, it runs until it terminates or willingly gives up control simple and efficient to implement – few context switches examples: Windows 3.1, early Mac OS all other scheduling is preemptive  process can be "forced" to give up the CPU (e.g., timeout, higher priority process) more sophisticated and powerful examples: Windows 95/98/NT/2K, Mac OS-X, UNIX
  • 17.  Preemptive vs Non-Preemptive Scheduling  Scheduling is non-preemptive if once the CPU has been allocated to a process, the process can keep the CPU until it releases it, either by terminating or switching to the waiting state.  Scheduling is preemptive if the CPU can be taken away from a process during execution.
  • 18. Priority scheduling each process is assigned a numeric priority  CPU is allocated to the process with the highest priority  priorities can be external (set by user/admin) or internal  (based on resources/history)  SJF is priority scheduling where priority is the predicted  next CPU burst time priority scheduling may be preemptive or nonpreemptive  priority scheduling is not fair  starvation is possible – low priority processes may never execute  can be made fair using aging – as time progresses, increase the priority  Aging is a technique of gradually increasing the priority of processes that wait in the system for a long time

Editor's Notes

  1. Aging - Gradually increasing the priority of process that waits in the system for long time.