SlideShare a Scribd company logo
PROCESS
SCHEDULING
Sunawar Khan
MS(CS)
IIUI
Reference:-
After Reading This Topic. . .
Goals of
processor
scheduling.
Preemptive
vs. Non
preemptive
scheduling.
Role of
priorities in
scheduling.
Scheduling
criteria.
Common
scheduling
algorithms.
Reference:-
What is Process Scheduling?
Assignment of Processor to process to accomplish the work
When process should be assigned to which process is Process Scheduling
When more than one process is runnable, UPU must decide priority
Part of OS concerned with this decision is called Scheduler.
To solve this problem with different algorithm is called Scheduling Algorithm
http://www.cs.kent.edu/~rmuhamma/
Reference:-
Basic Concept
■ Maximum CPU utilization obtained
with multiprogramming
■ CPU–I/O Burst Cycle – Process
execution consists of a cycle of CPU
execution and I/O wait
■ CPU burst followed by I/O burst
■ CPU burst distribution is of main
concern
Silberchatz, Galvin and Gagne Operating System, 9th Edition
Reference:-
Policy To Process Scheduling
Decides which process runs at given time
Different schedulers goals Maximize throughput
Minimize latency
Prevent indefinite postponement
Complete process by given deadline
Maximize processor utilization
http://www.cs.kent.edu/~rmuhamma/
Reference:-
What the Scheduler try to achieve
•Maximize throughput
•Response Time
•Minimize resource utilization
•Avoid indefinite postponement
•Enforce priorities
•Minimize overhead
•Ensure predictability
•Policy Enforcement
Different objectives depending on system
Deitel & Deitel, Operating System
Reference:-
General Goals
Goals
Fairness Predictability Scalability
http://www.cs.kent.edu/~rmuhamma/
Reference:-
Scheduling Levels
High-level
scheduling
•Determines which jobs can compete for resources
•Controls number of processes in system at one time
Intermediate-
level
scheduling
•Determines which processes can compete for processors
•Responds to fluctuations in system load
Low-level
scheduling
•Assigns priorities
•Assigns processors to processes
Deitel & Deitel, Operating System
Reference:-
Scheduling Levels
Deitel & Deitel, Operating System
Reference:-
Preemptive vs. Nonpreemptive Scheduling
Preemptive
processes
Can be removed from their current processor
Can lead to improved response times
Important for interactive environments
Preempted processes remain in memory
Nonpreemptive
processes
Run until completion or until they yield control of a
processor
Unimportant processes can block important ones
indefinitely
http://www.cs.kent.edu/~rmuhamma/
Reference:-
CPU Scheduler
 Short-term scheduler selects from among the processes in ready queue, and
allocates the CPU to one of them
 Queue may be ordered in various ways
 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
 Consider access to shared data
 Consider preemption while in kernel mode
 Consider interrupts occurring during crucial OS activities
Silberchatz, Galvin and Gagne Operating System, 9th Edition
Reference:-
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
■ 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)
Silberchatz, Galvin and Gagne Operating System, 9th Edition
Reference:-
Scheduling Algorithm Optimization Criteria
■ Max CPU utilization
■ Max throughput
■ Min turnaround time
■ Min waiting time
■ Min response time
Silberchatz, Galvin and Gagne Operating System, 9th Edition
Reference:-14
Scheduling Algorithms
Scheduling
algorithms
Decide when and for how long each
process runs
Make choices about Preemptibility
Priority
Running time
Run-time-to-completion
fairness
Reference:-
First-In-First-Out (FIFO) Scheduling
FIFO
scheduling
•Simplest scheme
•Processes dispatched according to
arrival time
•Nonpreemptible
•Rarely used as primary scheduling
algorithm
Reference:-
FIFO
Process Burst Time
P1 24
P2 3
P3 3
■ Suppose that the processes arrive in the order: P1 , P2 , P3
The Gantt Chart for the schedule is:
■ Waiting time for P1 = 0; P2 = 24; P3 = 27
■ Average waiting time: (0 + 24 + 27)/3 = 17
P P P1 2 3
0 24 3027
Reference:-
FIFO (Cont.)
Suppose that the processes arrive in the order:
P2 , P3 , P1
■ The Gantt chart for the schedule is:
■ Waiting time for P1 = 6; P2 = 0; P3 = 3
■ Average waiting time: (6 + 0 + 3)/3 = 3
■ Much better than previous case
■ Convoy effect - short process behind long process
– Consider one CPU-bound and many I/O-bound processes
P1
0 3 6 30
P2
P3
Reference:-
Round-Robin (RR) Scheduling
■ Round-robin scheduling
– Based on FIFO
– Processes run only for a limited amount of time called a time
slice or quantum
– Preemptible
– Requires the system to maintain several processes in memory
to minimize overhead
– Often used as part of more complex algorithms
Reference:-
Round Robin(RR) Scheduling
■ Each process gets a small unit of CPU time (time quantum q), usually 10-100 milliseconds.
After this time has elapsed, the process is preempted and added to the end of the ready
queue.
■ If there are n processes in the ready queue and the time quantum is q, then each process
gets 1/n of the CPU time in chunks of at most q time units at once. No process waits more
than (n-1)q time units.
■ Timer interrupts every quantum to schedule next process
■ Performance
– q large  FIFO
– q small  q must be large with respect to context switch, otherwise overhead is too
high
Reference:-
Round Robin(RR) Scheduling
Reference:-
Example of RR with Time Quantum = 4
Process Burst Time
P1 24
P2 3
P3 3
■ The Gantt chart is:
■ Typically, higher average turnaround than SJF, but better response
■ q should be large compared to context switch time
■ q usually 10ms to 100ms, context switch < 10 usec
P P P1 1 1
0 18 3026144 7 10 22
P2
P3
P1
P1
P1
Reference:-
Time Quantum and Context Switch Time
Reference:-
Turnaround Time Varies With The Time Quantum
80% of CPU bursts
should be shorter than q
Reference:-24
Round-Robin (RR) Scheduling
■ Selfish round-robin scheduling
– Increases priority as process ages
– Two queues
■ Active
■ Holding
– Favors older processes to avoids unreasonable
delays
Reference:-25
Round-Robin (RR) Scheduling
■ Quantum size
– Determines response time to interactive requests
– Very large quantum size
■ Processes run for long periods
■ Degenerates to FIFO
– Very small quantum size
■ System spends more time context switching than running processes
– Middle-ground
■ Long enough for interactive processes to issue I/O request
■ Batch processes still get majority of processor time
Reference:-
Shortest-Process-First (SPF) Scheduling
■ Scheduler selects process with smallest time to finish
– Lower average wait time than FIFO
■ Reduces the number of waiting processes
– Potentially large variance in wait times
– Nonpreemptive
■ Results in slow response times to arriving interactive requests
– Relies on estimates of time-to-completion
■ Can be inaccurate or falsified
– Unsuitable for use in modern interactive systems
Reference:-
Shortest-Process-First (SPF) Scheduling
■ Associate with each process the length of its next CPU
burst
– Use these lengths to schedule the process with the
shortest time
■ SJF is optimal – gives minimum average waiting time for a
given set of processes
– The difficulty is knowing the length of the next CPU
request
– Could ask the user
Reference:-
Example of SJF
ProcessArriva l Time Burst Time
P1 0.0 6
P2 2.0 8
P3 4.0 7
P4 5.0 3
■ SJF scheduling chart
■ Average waiting time = (3 + 16 + 9 + 0) / 4 = 7
P3
0 3 24
P4
P1
169
P2
Reference:-
Determining Length of Next CPU Burst
■ Can only estimate the length – should be similar to the previous one
– Then pick process with shortest predicted next CPU burst
■ Can be done by using the length of previous CPU bursts, using
exponential averaging
■ Commonly, α set to ½
■ Preemptive version called shortest-remaining-time-first
:Define4.
10,3.
burstCPUnexttheforvaluepredicted2.
burstCPUoflengthactual1.





 1n
th
n nt
  .11 nnn t  
Reference:-
Prediction of the Length of the Next CPU Burst
Reference:-
Examples of Exponential Averaging
■  =0
– n+1 = n
– Recent history does not count
■  =1
– n+1 =  tn
– Only the actual last CPU burst counts
■ If we expand the formula, we get:
n+1 =  tn+(1 - ) tn -1 + …
+(1 -  )j  tn -j + …
+(1 -  )n +1 0
■ Since both  and (1 - ) are less than or equal to 1, each successive term has less
weight than its predecessor
Reference:-
Example of Shortest-remaining-time-first
■ Now we add the concepts of varying arrival times and preemption to the analysis
ProcessAarri Arrival TimeT Burst Time
P1 0 8
P2 1 4
P3 2 9
P4 3 5
■ Preemptive SJF Gantt Chart
■ Average waiting time = [(10-1)+(1-1)+(17-2)+5-3)]/4 = 26/4 = 6.5 msec
P4
0 1 26
P1
P2
10
P3
P1
5 17
Reference:-
Multilevel Queue
■ Ready queue is partitioned into separate queues, eg:
– foreground (interactive)
– background (batch)
■ Process permanently in a given queue
■ Each queue has its own scheduling algorithm:
– foreground – RR
– background – FCFS
■ Scheduling must be done between the queues:
– Fixed priority scheduling; (i.e., serve all from foreground then from background).
Possibility of starvation.
– Time slice – each queue gets a certain amount of CPU time which it can schedule
amongst its processes; i.e., 80% to foreground in RR
– 20% to background in FCFS
Reference:-34
Multilevel Feedback Queues
■ Different processes have different needs
– Short I/O-bound interactive processes should generally run before
processor-bound batch processes
– Behavior patterns not immediately obvious to the scheduler
■ Multilevel feedback queues
– Arriving processes enter the highest-level queue and execute with higher
priority than processes in lower queues
– Long processes repeatedly descend into lower levels
■ Gives short processes and I/O-bound processes higher priority
■ Long processes will run when short and I/O-bound processes terminate
– Processes in each queue are serviced using round-robin
■ Process entering a higher-level queue preempt running processes
Reference:-35
Multilevel Feedback Queues
■ Algorithm must respond to changes in environment
– Move processes to different queues as they alternate between
interactive and batch behavior
■ Example of an adaptive mechanism
– Adaptive mechanisms incur overhead that often is offset by
increased sensitivity to process behavior
Reference:-
Multilevel Queue Scheduling
Reference:-
Multi Level Queue Scheduling
Reference:-
Multilevel Feedback Queue
■ A process can move between the various queues; aging can be
implemented this way
■ Multilevel-feedback-queue scheduler defined by the following
parameters:
– number of queues
– scheduling algorithms for each queue
– method used to determine when to upgrade a process
– method used to determine when to demote a process
– method used to determine which queue a process will enter
when that process needs service
Reference:-
Example of Multilevel Feedback Queue
■ Three queues:
– Q0 – RR with time quantum 8 milliseconds
– Q1 – RR time quantum 16 milliseconds
– Q2 – FCFS
■ Scheduling
– A new job enters queue Q0 which is served
FCFS
■ When it gains CPU, job receives 8
milliseconds
■ If it does not finish in 8
milliseconds, job is moved to queue
Q1
– At Q1 job is again served FCFS and
receives 16 additional milliseconds
■ If it still does not complete, it is
preempted and moved to queue Q2

More Related Content

What's hot

Process scheduling
Process schedulingProcess scheduling
Process scheduling
Deepika Balichwal
 
Operating Systems Process Scheduling Algorithms
Operating Systems   Process Scheduling AlgorithmsOperating Systems   Process Scheduling Algorithms
Operating Systems Process Scheduling Algorithms
sathish sak
 
CPU Scheduling in OS Presentation
CPU Scheduling in OS  PresentationCPU Scheduling in OS  Presentation
CPU Scheduling in OS Presentation
usmankiyani1
 
Real-Time Scheduling Algorithms
Real-Time Scheduling AlgorithmsReal-Time Scheduling Algorithms
Real-Time Scheduling Algorithms
AJAL A J
 
Contiguous Memory Allocation-R.D.Sivakumar
Contiguous Memory Allocation-R.D.SivakumarContiguous Memory Allocation-R.D.Sivakumar
Contiguous Memory Allocation-R.D.Sivakumar
Sivakumar R D .
 
First Come First Serve & Shortest Job First-(FCFS & SJF)
First Come First Serve & Shortest Job First-(FCFS & SJF)First Come First Serve & Shortest Job First-(FCFS & SJF)
First Come First Serve & Shortest Job First-(FCFS & SJF)
Adeel Rasheed
 
Monitors
MonitorsMonitors
Monitors
Mohd Arif
 
Semaphores
SemaphoresSemaphores
Semaphores
Mohd Arif
 
cpu scheduling
cpu schedulingcpu scheduling
cpu scheduling
hashim102
 
Allocation of Frames & Thrashing
Allocation of Frames & ThrashingAllocation of Frames & Thrashing
Allocation of Frames & Thrashing
arifmollick8578
 
CPU scheduling algorithms in OS
CPU scheduling algorithms in OSCPU scheduling algorithms in OS
CPU scheduling algorithms in OS
harini0810
 
Operating System-Process Scheduling
Operating System-Process SchedulingOperating System-Process Scheduling
Operating System-Process Scheduling
Shipra Swati
 
SCHEDULING ALGORITHMS
SCHEDULING ALGORITHMSSCHEDULING ALGORITHMS
SCHEDULING ALGORITHMS
Dhaval Sakhiya
 
Scheduling
SchedulingScheduling
Scheduling
Mohd Arif
 
Context Switching
Context SwitchingContext Switching
Context Switching
franksvalli
 
Semaphore
SemaphoreSemaphore
Semaphore
Arafat Hossan
 
PAGIN AND SEGMENTATION.docx
PAGIN AND SEGMENTATION.docxPAGIN AND SEGMENTATION.docx
PAGIN AND SEGMENTATION.docx
ImranBhatti58
 
Memory management
Memory managementMemory management
Memory management
Vishal Singh
 
CPU Scheduling algorithms
CPU Scheduling algorithmsCPU Scheduling algorithms
CPU Scheduling algorithms
Shanu Kumar
 
Deadlock
DeadlockDeadlock
Deadlock
Mohd Arif
 

What's hot (20)

Process scheduling
Process schedulingProcess scheduling
Process scheduling
 
Operating Systems Process Scheduling Algorithms
Operating Systems   Process Scheduling AlgorithmsOperating Systems   Process Scheduling Algorithms
Operating Systems Process Scheduling Algorithms
 
CPU Scheduling in OS Presentation
CPU Scheduling in OS  PresentationCPU Scheduling in OS  Presentation
CPU Scheduling in OS Presentation
 
Real-Time Scheduling Algorithms
Real-Time Scheduling AlgorithmsReal-Time Scheduling Algorithms
Real-Time Scheduling Algorithms
 
Contiguous Memory Allocation-R.D.Sivakumar
Contiguous Memory Allocation-R.D.SivakumarContiguous Memory Allocation-R.D.Sivakumar
Contiguous Memory Allocation-R.D.Sivakumar
 
First Come First Serve & Shortest Job First-(FCFS & SJF)
First Come First Serve & Shortest Job First-(FCFS & SJF)First Come First Serve & Shortest Job First-(FCFS & SJF)
First Come First Serve & Shortest Job First-(FCFS & SJF)
 
Monitors
MonitorsMonitors
Monitors
 
Semaphores
SemaphoresSemaphores
Semaphores
 
cpu scheduling
cpu schedulingcpu scheduling
cpu scheduling
 
Allocation of Frames & Thrashing
Allocation of Frames & ThrashingAllocation of Frames & Thrashing
Allocation of Frames & Thrashing
 
CPU scheduling algorithms in OS
CPU scheduling algorithms in OSCPU scheduling algorithms in OS
CPU scheduling algorithms in OS
 
Operating System-Process Scheduling
Operating System-Process SchedulingOperating System-Process Scheduling
Operating System-Process Scheduling
 
SCHEDULING ALGORITHMS
SCHEDULING ALGORITHMSSCHEDULING ALGORITHMS
SCHEDULING ALGORITHMS
 
Scheduling
SchedulingScheduling
Scheduling
 
Context Switching
Context SwitchingContext Switching
Context Switching
 
Semaphore
SemaphoreSemaphore
Semaphore
 
PAGIN AND SEGMENTATION.docx
PAGIN AND SEGMENTATION.docxPAGIN AND SEGMENTATION.docx
PAGIN AND SEGMENTATION.docx
 
Memory management
Memory managementMemory management
Memory management
 
CPU Scheduling algorithms
CPU Scheduling algorithmsCPU Scheduling algorithms
CPU Scheduling algorithms
 
Deadlock
DeadlockDeadlock
Deadlock
 

Viewers also liked

5 Process Scheduling
5 Process Scheduling5 Process Scheduling
5 Process Scheduling
Dr. Loganathan R
 
Os Threads
Os ThreadsOs Threads
Os Threads
Salman Memon
 
Threads (operating System)
Threads (operating System)Threads (operating System)
Threads (operating System)
Prakhar Maurya
 
Process scheduling
Process schedulingProcess scheduling
Process scheduling
Prasunjeet Soni
 
Operating System-Threads-Galvin
Operating System-Threads-GalvinOperating System-Threads-Galvin
Operating System-Threads-Galvin
Sonali Chauhan
 
Inter process communication
Inter process communicationInter process communication
Inter process communication
Mohd Tousif
 
Process Scheduling
Process SchedulingProcess Scheduling
Process Scheduling
Abhishek Nagar
 
Interprocess Communication
Interprocess CommunicationInterprocess Communication
Interprocess Communication
Deepak H L
 
Inter process communication
Inter process communicationInter process communication
Inter process communication
RJ Mehul Gadhiya
 
Inter Process Communication
Inter Process CommunicationInter Process Communication
Inter Process Communication
Anil Kumar Pugalia
 

Viewers also liked (10)

5 Process Scheduling
5 Process Scheduling5 Process Scheduling
5 Process Scheduling
 
Os Threads
Os ThreadsOs Threads
Os Threads
 
Threads (operating System)
Threads (operating System)Threads (operating System)
Threads (operating System)
 
Process scheduling
Process schedulingProcess scheduling
Process scheduling
 
Operating System-Threads-Galvin
Operating System-Threads-GalvinOperating System-Threads-Galvin
Operating System-Threads-Galvin
 
Inter process communication
Inter process communicationInter process communication
Inter process communication
 
Process Scheduling
Process SchedulingProcess Scheduling
Process Scheduling
 
Interprocess Communication
Interprocess CommunicationInterprocess Communication
Interprocess Communication
 
Inter process communication
Inter process communicationInter process communication
Inter process communication
 
Inter Process Communication
Inter Process CommunicationInter Process Communication
Inter Process Communication
 

Similar to Process Scheduling

Os2
Os2Os2
Operating System Scheduling
Operating System SchedulingOperating System Scheduling
Operating System Scheduling
Vishnu Prasad
 
Window scheduling algorithm
Window scheduling algorithmWindow scheduling algorithm
Window scheduling algorithm
Binal Parekh
 
OS Process Chapter 3.pdf
OS Process Chapter 3.pdfOS Process Chapter 3.pdf
OS Process Chapter 3.pdf
Kp Sharma
 
CPU Scheduling.pdf
CPU Scheduling.pdfCPU Scheduling.pdf
CPU Scheduling
CPU SchedulingCPU Scheduling
CPU Scheduling
sammerkhan1
 
Ch5
Ch5Ch5
Scheduling algo(by HJ)
Scheduling algo(by HJ)Scheduling algo(by HJ)
Scheduling algo(by HJ)
Harshit Jain
 
Operating System 5
Operating System 5Operating System 5
Operating System 5
tech2click
 
Operating Systems - CPU Scheduling Process
Operating Systems - CPU Scheduling ProcessOperating Systems - CPU Scheduling Process
Operating Systems - CPU Scheduling Process
Chandrakant Divate
 
Ch6
Ch6Ch6
Ch6
C.U
 
Ch05
Ch05Ch05
cpu sechduling
cpu sechduling cpu sechduling
cpu sechduling
gopi7
 
Process management in os
Process management in osProcess management in os
Process management in os
Miong Lazaro
 
OS_Ch6
OS_Ch6OS_Ch6
OSCh6
OSCh6OSCh6
ch5_CPU Scheduling_part1.pdf
ch5_CPU Scheduling_part1.pdfch5_CPU Scheduling_part1.pdf
ch5_CPU Scheduling_part1.pdf
SonaliAjankar
 
CH06.pdf
CH06.pdfCH06.pdf
CH06.pdf
ImranKhan880955
 
ch_scheduling (1).ppt
ch_scheduling (1).pptch_scheduling (1).ppt
ch_scheduling (1).ppt
Farhanahmad540205
 
Distributed Operating System_2
Distributed Operating System_2Distributed Operating System_2
Distributed Operating System_2
Dr Sandeep Kumar Poonia
 

Similar to Process Scheduling (20)

Os2
Os2Os2
Os2
 
Operating System Scheduling
Operating System SchedulingOperating System Scheduling
Operating System Scheduling
 
Window scheduling algorithm
Window scheduling algorithmWindow scheduling algorithm
Window scheduling algorithm
 
OS Process Chapter 3.pdf
OS Process Chapter 3.pdfOS Process Chapter 3.pdf
OS Process Chapter 3.pdf
 
CPU Scheduling.pdf
CPU Scheduling.pdfCPU Scheduling.pdf
CPU Scheduling.pdf
 
CPU Scheduling
CPU SchedulingCPU Scheduling
CPU Scheduling
 
Ch5
Ch5Ch5
Ch5
 
Scheduling algo(by HJ)
Scheduling algo(by HJ)Scheduling algo(by HJ)
Scheduling algo(by HJ)
 
Operating System 5
Operating System 5Operating System 5
Operating System 5
 
Operating Systems - CPU Scheduling Process
Operating Systems - CPU Scheduling ProcessOperating Systems - CPU Scheduling Process
Operating Systems - CPU Scheduling Process
 
Ch6
Ch6Ch6
Ch6
 
Ch05
Ch05Ch05
Ch05
 
cpu sechduling
cpu sechduling cpu sechduling
cpu sechduling
 
Process management in os
Process management in osProcess management in os
Process management in os
 
OS_Ch6
OS_Ch6OS_Ch6
OS_Ch6
 
OSCh6
OSCh6OSCh6
OSCh6
 
ch5_CPU Scheduling_part1.pdf
ch5_CPU Scheduling_part1.pdfch5_CPU Scheduling_part1.pdf
ch5_CPU Scheduling_part1.pdf
 
CH06.pdf
CH06.pdfCH06.pdf
CH06.pdf
 
ch_scheduling (1).ppt
ch_scheduling (1).pptch_scheduling (1).ppt
ch_scheduling (1).ppt
 
Distributed Operating System_2
Distributed Operating System_2Distributed Operating System_2
Distributed Operating System_2
 

More from International Islamic University

Hash tables
Hash tablesHash tables
Binary Search Tree
Binary Search TreeBinary Search Tree
Graph 1
Graph 1Graph 1
Graph 2
Graph 2Graph 2
Graph 3
Graph 3Graph 3
Greedy algorithm
Greedy algorithmGreedy algorithm
Dynamic programming
Dynamic programmingDynamic programming
Quick sort
Quick sortQuick sort
Merge sort
Merge sortMerge sort
Linear timesorting
Linear timesortingLinear timesorting
Facial Expression Recognitino
Facial Expression RecognitinoFacial Expression Recognitino
Facial Expression Recognitino
International Islamic University
 
Lecture#4
Lecture#4Lecture#4
Lecture#3
Lecture#3 Lecture#3
Lecture#2
Lecture#2 Lecture#2
Case study
Case studyCase study
Arrays
ArraysArrays
Pcb
PcbPcb
Data transmission
Data transmissionData transmission
Basic organization of computer
Basic organization of computerBasic organization of computer
Basic organization of computer
International Islamic University
 
Sorting techniques
Sorting techniquesSorting techniques

More from International Islamic University (20)

Hash tables
Hash tablesHash tables
Hash tables
 
Binary Search Tree
Binary Search TreeBinary Search Tree
Binary Search Tree
 
Graph 1
Graph 1Graph 1
Graph 1
 
Graph 2
Graph 2Graph 2
Graph 2
 
Graph 3
Graph 3Graph 3
Graph 3
 
Greedy algorithm
Greedy algorithmGreedy algorithm
Greedy algorithm
 
Dynamic programming
Dynamic programmingDynamic programming
Dynamic programming
 
Quick sort
Quick sortQuick sort
Quick sort
 
Merge sort
Merge sortMerge sort
Merge sort
 
Linear timesorting
Linear timesortingLinear timesorting
Linear timesorting
 
Facial Expression Recognitino
Facial Expression RecognitinoFacial Expression Recognitino
Facial Expression Recognitino
 
Lecture#4
Lecture#4Lecture#4
Lecture#4
 
Lecture#3
Lecture#3 Lecture#3
Lecture#3
 
Lecture#2
Lecture#2 Lecture#2
Lecture#2
 
Case study
Case studyCase study
Case study
 
Arrays
ArraysArrays
Arrays
 
Pcb
PcbPcb
Pcb
 
Data transmission
Data transmissionData transmission
Data transmission
 
Basic organization of computer
Basic organization of computerBasic organization of computer
Basic organization of computer
 
Sorting techniques
Sorting techniquesSorting techniques
Sorting techniques
 

Recently uploaded

Electric Fetus - Record Store Scavenger Hunt
Electric Fetus - Record Store Scavenger HuntElectric Fetus - Record Store Scavenger Hunt
Electric Fetus - Record Store Scavenger Hunt
RamseyBerglund
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
Nicholas Montgomery
 
BBR 2024 Summer Sessions Interview Training
BBR  2024 Summer Sessions Interview TrainingBBR  2024 Summer Sessions Interview Training
BBR 2024 Summer Sessions Interview Training
Katrina Pritchard
 
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptxBeyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
EduSkills OECD
 
Benner "Expanding Pathways to Publishing Careers"
Benner "Expanding Pathways to Publishing Careers"Benner "Expanding Pathways to Publishing Careers"
Benner "Expanding Pathways to Publishing Careers"
National Information Standards Organization (NISO)
 
Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47
MysoreMuleSoftMeetup
 
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skillsspot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
haiqairshad
 
Wound healing PPT
Wound healing PPTWound healing PPT
Wound healing PPT
Jyoti Chand
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
mulvey2
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
Jean Carlos Nunes Paixão
 
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
GeorgeMilliken2
 
B. Ed Syllabus for babasaheb ambedkar education university.pdf
B. Ed Syllabus for babasaheb ambedkar education university.pdfB. Ed Syllabus for babasaheb ambedkar education university.pdf
B. Ed Syllabus for babasaheb ambedkar education university.pdf
BoudhayanBhattachari
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
History of Stoke Newington
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
Nguyen Thanh Tu Collection
 
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UPLAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
RAHUL
 
Bonku-Babus-Friend by Sathyajith Ray (9)
Bonku-Babus-Friend by Sathyajith Ray  (9)Bonku-Babus-Friend by Sathyajith Ray  (9)
Bonku-Babus-Friend by Sathyajith Ray (9)
nitinpv4ai
 
REASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdf
REASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdfREASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdf
REASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdf
giancarloi8888
 
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
Nguyen Thanh Tu Collection
 
Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...
PsychoTech Services
 
BIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptx
BIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptxBIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptx
BIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptx
RidwanHassanYusuf
 

Recently uploaded (20)

Electric Fetus - Record Store Scavenger Hunt
Electric Fetus - Record Store Scavenger HuntElectric Fetus - Record Store Scavenger Hunt
Electric Fetus - Record Store Scavenger Hunt
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
 
BBR 2024 Summer Sessions Interview Training
BBR  2024 Summer Sessions Interview TrainingBBR  2024 Summer Sessions Interview Training
BBR 2024 Summer Sessions Interview Training
 
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptxBeyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
 
Benner "Expanding Pathways to Publishing Careers"
Benner "Expanding Pathways to Publishing Careers"Benner "Expanding Pathways to Publishing Careers"
Benner "Expanding Pathways to Publishing Careers"
 
Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47
 
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skillsspot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
 
Wound healing PPT
Wound healing PPTWound healing PPT
Wound healing PPT
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
 
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
 
B. Ed Syllabus for babasaheb ambedkar education university.pdf
B. Ed Syllabus for babasaheb ambedkar education university.pdfB. Ed Syllabus for babasaheb ambedkar education university.pdf
B. Ed Syllabus for babasaheb ambedkar education university.pdf
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
 
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UPLAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
 
Bonku-Babus-Friend by Sathyajith Ray (9)
Bonku-Babus-Friend by Sathyajith Ray  (9)Bonku-Babus-Friend by Sathyajith Ray  (9)
Bonku-Babus-Friend by Sathyajith Ray (9)
 
REASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdf
REASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdfREASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdf
REASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdf
 
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
 
Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...
 
BIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptx
BIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptxBIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptx
BIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptx
 

Process Scheduling

  • 2. Reference:- After Reading This Topic. . . Goals of processor scheduling. Preemptive vs. Non preemptive scheduling. Role of priorities in scheduling. Scheduling criteria. Common scheduling algorithms.
  • 3. Reference:- What is Process Scheduling? Assignment of Processor to process to accomplish the work When process should be assigned to which process is Process Scheduling When more than one process is runnable, UPU must decide priority Part of OS concerned with this decision is called Scheduler. To solve this problem with different algorithm is called Scheduling Algorithm http://www.cs.kent.edu/~rmuhamma/
  • 4. Reference:- Basic Concept ■ Maximum CPU utilization obtained with multiprogramming ■ CPU–I/O Burst Cycle – Process execution consists of a cycle of CPU execution and I/O wait ■ CPU burst followed by I/O burst ■ CPU burst distribution is of main concern Silberchatz, Galvin and Gagne Operating System, 9th Edition
  • 5. Reference:- Policy To Process Scheduling Decides which process runs at given time Different schedulers goals Maximize throughput Minimize latency Prevent indefinite postponement Complete process by given deadline Maximize processor utilization http://www.cs.kent.edu/~rmuhamma/
  • 6. Reference:- What the Scheduler try to achieve •Maximize throughput •Response Time •Minimize resource utilization •Avoid indefinite postponement •Enforce priorities •Minimize overhead •Ensure predictability •Policy Enforcement Different objectives depending on system Deitel & Deitel, Operating System
  • 7. Reference:- General Goals Goals Fairness Predictability Scalability http://www.cs.kent.edu/~rmuhamma/
  • 8. Reference:- Scheduling Levels High-level scheduling •Determines which jobs can compete for resources •Controls number of processes in system at one time Intermediate- level scheduling •Determines which processes can compete for processors •Responds to fluctuations in system load Low-level scheduling •Assigns priorities •Assigns processors to processes Deitel & Deitel, Operating System
  • 9. Reference:- Scheduling Levels Deitel & Deitel, Operating System
  • 10. Reference:- Preemptive vs. Nonpreemptive Scheduling Preemptive processes Can be removed from their current processor Can lead to improved response times Important for interactive environments Preempted processes remain in memory Nonpreemptive processes Run until completion or until they yield control of a processor Unimportant processes can block important ones indefinitely http://www.cs.kent.edu/~rmuhamma/
  • 11. Reference:- CPU Scheduler  Short-term scheduler selects from among the processes in ready queue, and allocates the CPU to one of them  Queue may be ordered in various ways  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  Consider access to shared data  Consider preemption while in kernel mode  Consider interrupts occurring during crucial OS activities Silberchatz, Galvin and Gagne Operating System, 9th Edition
  • 12. Reference:- 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 ■ 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) Silberchatz, Galvin and Gagne Operating System, 9th Edition
  • 13. Reference:- Scheduling Algorithm Optimization Criteria ■ Max CPU utilization ■ Max throughput ■ Min turnaround time ■ Min waiting time ■ Min response time Silberchatz, Galvin and Gagne Operating System, 9th Edition
  • 14. Reference:-14 Scheduling Algorithms Scheduling algorithms Decide when and for how long each process runs Make choices about Preemptibility Priority Running time Run-time-to-completion fairness
  • 15. Reference:- First-In-First-Out (FIFO) Scheduling FIFO scheduling •Simplest scheme •Processes dispatched according to arrival time •Nonpreemptible •Rarely used as primary scheduling algorithm
  • 16. Reference:- FIFO Process Burst Time P1 24 P2 3 P3 3 ■ Suppose that the processes arrive in the order: P1 , P2 , P3 The Gantt Chart for the schedule is: ■ Waiting time for P1 = 0; P2 = 24; P3 = 27 ■ Average waiting time: (0 + 24 + 27)/3 = 17 P P P1 2 3 0 24 3027
  • 17. Reference:- FIFO (Cont.) Suppose that the processes arrive in the order: P2 , P3 , P1 ■ The Gantt chart for the schedule is: ■ Waiting time for P1 = 6; P2 = 0; P3 = 3 ■ Average waiting time: (6 + 0 + 3)/3 = 3 ■ Much better than previous case ■ Convoy effect - short process behind long process – Consider one CPU-bound and many I/O-bound processes P1 0 3 6 30 P2 P3
  • 18. Reference:- Round-Robin (RR) Scheduling ■ Round-robin scheduling – Based on FIFO – Processes run only for a limited amount of time called a time slice or quantum – Preemptible – Requires the system to maintain several processes in memory to minimize overhead – Often used as part of more complex algorithms
  • 19. Reference:- Round Robin(RR) Scheduling ■ Each process gets a small unit of CPU time (time quantum q), usually 10-100 milliseconds. After this time has elapsed, the process is preempted and added to the end of the ready queue. ■ If there are n processes in the ready queue and the time quantum is q, then each process gets 1/n of the CPU time in chunks of at most q time units at once. No process waits more than (n-1)q time units. ■ Timer interrupts every quantum to schedule next process ■ Performance – q large  FIFO – q small  q must be large with respect to context switch, otherwise overhead is too high
  • 21. Reference:- Example of RR with Time Quantum = 4 Process Burst Time P1 24 P2 3 P3 3 ■ The Gantt chart is: ■ Typically, higher average turnaround than SJF, but better response ■ q should be large compared to context switch time ■ q usually 10ms to 100ms, context switch < 10 usec P P P1 1 1 0 18 3026144 7 10 22 P2 P3 P1 P1 P1
  • 22. Reference:- Time Quantum and Context Switch Time
  • 23. Reference:- Turnaround Time Varies With The Time Quantum 80% of CPU bursts should be shorter than q
  • 24. Reference:-24 Round-Robin (RR) Scheduling ■ Selfish round-robin scheduling – Increases priority as process ages – Two queues ■ Active ■ Holding – Favors older processes to avoids unreasonable delays
  • 25. Reference:-25 Round-Robin (RR) Scheduling ■ Quantum size – Determines response time to interactive requests – Very large quantum size ■ Processes run for long periods ■ Degenerates to FIFO – Very small quantum size ■ System spends more time context switching than running processes – Middle-ground ■ Long enough for interactive processes to issue I/O request ■ Batch processes still get majority of processor time
  • 26. Reference:- Shortest-Process-First (SPF) Scheduling ■ Scheduler selects process with smallest time to finish – Lower average wait time than FIFO ■ Reduces the number of waiting processes – Potentially large variance in wait times – Nonpreemptive ■ Results in slow response times to arriving interactive requests – Relies on estimates of time-to-completion ■ Can be inaccurate or falsified – Unsuitable for use in modern interactive systems
  • 27. Reference:- Shortest-Process-First (SPF) Scheduling ■ Associate with each process the length of its next CPU burst – Use these lengths to schedule the process with the shortest time ■ SJF is optimal – gives minimum average waiting time for a given set of processes – The difficulty is knowing the length of the next CPU request – Could ask the user
  • 28. Reference:- Example of SJF ProcessArriva l Time Burst Time P1 0.0 6 P2 2.0 8 P3 4.0 7 P4 5.0 3 ■ SJF scheduling chart ■ Average waiting time = (3 + 16 + 9 + 0) / 4 = 7 P3 0 3 24 P4 P1 169 P2
  • 29. Reference:- Determining Length of Next CPU Burst ■ Can only estimate the length – should be similar to the previous one – Then pick process with shortest predicted next CPU burst ■ Can be done by using the length of previous CPU bursts, using exponential averaging ■ Commonly, α set to ½ ■ Preemptive version called shortest-remaining-time-first :Define4. 10,3. burstCPUnexttheforvaluepredicted2. burstCPUoflengthactual1.       1n th n nt   .11 nnn t  
  • 30. Reference:- Prediction of the Length of the Next CPU Burst
  • 31. Reference:- Examples of Exponential Averaging ■  =0 – n+1 = n – Recent history does not count ■  =1 – n+1 =  tn – Only the actual last CPU burst counts ■ If we expand the formula, we get: n+1 =  tn+(1 - ) tn -1 + … +(1 -  )j  tn -j + … +(1 -  )n +1 0 ■ Since both  and (1 - ) are less than or equal to 1, each successive term has less weight than its predecessor
  • 32. Reference:- Example of Shortest-remaining-time-first ■ Now we add the concepts of varying arrival times and preemption to the analysis ProcessAarri Arrival TimeT Burst Time P1 0 8 P2 1 4 P3 2 9 P4 3 5 ■ Preemptive SJF Gantt Chart ■ Average waiting time = [(10-1)+(1-1)+(17-2)+5-3)]/4 = 26/4 = 6.5 msec P4 0 1 26 P1 P2 10 P3 P1 5 17
  • 33. Reference:- Multilevel Queue ■ Ready queue is partitioned into separate queues, eg: – foreground (interactive) – background (batch) ■ Process permanently in a given queue ■ Each queue has its own scheduling algorithm: – foreground – RR – background – FCFS ■ Scheduling must be done between the queues: – Fixed priority scheduling; (i.e., serve all from foreground then from background). Possibility of starvation. – Time slice – each queue gets a certain amount of CPU time which it can schedule amongst its processes; i.e., 80% to foreground in RR – 20% to background in FCFS
  • 34. Reference:-34 Multilevel Feedback Queues ■ Different processes have different needs – Short I/O-bound interactive processes should generally run before processor-bound batch processes – Behavior patterns not immediately obvious to the scheduler ■ Multilevel feedback queues – Arriving processes enter the highest-level queue and execute with higher priority than processes in lower queues – Long processes repeatedly descend into lower levels ■ Gives short processes and I/O-bound processes higher priority ■ Long processes will run when short and I/O-bound processes terminate – Processes in each queue are serviced using round-robin ■ Process entering a higher-level queue preempt running processes
  • 35. Reference:-35 Multilevel Feedback Queues ■ Algorithm must respond to changes in environment – Move processes to different queues as they alternate between interactive and batch behavior ■ Example of an adaptive mechanism – Adaptive mechanisms incur overhead that often is offset by increased sensitivity to process behavior
  • 38. Reference:- Multilevel Feedback Queue ■ A process can move between the various queues; aging can be implemented this way ■ Multilevel-feedback-queue scheduler defined by the following parameters: – number of queues – scheduling algorithms for each queue – method used to determine when to upgrade a process – method used to determine when to demote a process – method used to determine which queue a process will enter when that process needs service
  • 39. Reference:- Example of Multilevel Feedback Queue ■ Three queues: – Q0 – RR with time quantum 8 milliseconds – Q1 – RR time quantum 16 milliseconds – Q2 – FCFS ■ Scheduling – A new job enters queue Q0 which is served FCFS ■ When it gains CPU, job receives 8 milliseconds ■ If it does not finish in 8 milliseconds, job is moved to queue Q1 – At Q1 job is again served FCFS and receives 16 additional milliseconds ■ If it still does not complete, it is preempted and moved to queue Q2