SlideShare ist ein Scribd-Unternehmen logo
1 von 31
Downloaden Sie, um offline zu lesen
Shri Ramswaroop Memorial
University
NAME – VAIBHAV SAHU
ROLL NO. – 202110101110079
COURSE – B.TECH CS-43
SUBJECT – OPERATING SYSTEMS
SUBJECT CODE- BCS4022
SESSION – 2023-24
SUBMITTED TO - NEERAJ KUMAR SIR
SUBMITTED BY- VAIBHAV SAHU
Scheduling Criteria
CPU utilization – keep the CPU as busy as possible (from 0% to
100%)
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
Optimization Criteria
 Max CPU utilization
Max throughput
Min turnaround time
Min waiting time
Min Response time




Scheduling Algorithems
 First Come First Serve Scheduling
Shortest Job First Scheduling
Priority Scheduling
Round-Robin Scheduling
Multilevel Queue Scheduling
Multilevel Feedback-Queue
Scheduling





First Come First Serve Scheduling (FCFS)
Process Burst time
P1 24
P2 3
P2 3
First Come First Serve Scheduling
 The average of waiting time in this
policy is usually quite long
 Waiting time for P1=0; P2=24; P3=27
Average waiting time=
(0+24+27)/3=17

First Come First
Serve Scheduling
 Suppose we change the order of
arriving job P2, P3, P1
First Come First
Serve Scheduling
 Consider if we have a CPU-bound process and
many I/O-bound processes
 There is a convoy effect as all the other
processes waiting for one of the big process
to get off the CPU
 FCFS scheduling algorithm is non-preemptive
Short job first scheduling (SJF)
 This algorithm associates with each
process the length of the processes’
next CPU burst
 If there is a tie, FCFS is used
In other words, this algorithm can be
also regard as shortest-next-cpu-burst
algorithm

Short job first scheduling
 SJF is optimal – gives minimum average
waiting time for a given set of
processes
Example
Processes Burst time
P1 6
P2 8
P3 7
P4 3
FCFS average waiting time: (0+6+14+21)/4=10.25
SJF average waiting time: (3+16+9+0)/4=7
Short job first scheduling
Two schemes:
Non-preemptive – 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)
Short job first scheduling-
Non-preemptive
Short job first scheduling-
Preemptive
Priority Scheduling
A priority number (integer) is associated with each
process
The CPU is allocated to the process with the highest
priority
(smallest integer ≡ highest priority)


Preemptive
Non-preemptive
SJF is a special priority scheduling where priority is the
predicted next CPU burst time, so that it can decide
the priority
Priority Scheduling
Processes Burst time Priority Arrival time
P1 10 3
P2 1 1
P3 2 4
P4 1 5
P5 5 2
The average waiting
time=(6+0+16+18+1)/5=8.2
Priority Scheduling
Processes Burst time Priority Arrival time
P1 10 3 0.0
P2 1 1 1.0
P3 2 4 2.0
P4 1 5 3.0
P5 5 2 4.0
Gantt chart for both preemptive and non-
preemptive, also waiting time
Priority Scheduling
Problem : Starvation – low priority
processes may never execute
Solution : Aging – as time progresses
increase the priority of the process
Round-Robin Scheduling
 The Round-Robin is designed especially
for time sharing systems.
It is similar FCFS but add preemption
concept
A small unit of time, called time
quantum, is defined


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.
Round-Robin Scheduling
Round-Robin Scheduling
 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.
Round-Robin Scheduling
Performance
 q large => FIFO
 q small => q must be large with
respect to context switch, otherwise
overhead is too high
 Typically, higher average turnaround
than SJF, but better response
Round-Robin Scheduling
Multilevel Queue
Ready queue is partitioned into separate
queues:
 foreground (interactive)
 background (batch)
Each queue has its own scheduling algorithm
foreground – RR
background – FCFS
Multilevel Queue example
 Foreground P1 53 (RR interval:20)
P2 17
P3 42
 Background P4 30 (FCFS)
P5 20
Multilevel Queue
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

Multilevel Queue
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.
Multilevel Feedback Queue
Multilevel Feedback Queue
 P1 40
P2 35
P3 15



Weitere ähnliche Inhalte

Ähnlich wie csc4320chapter5-2-101203002830-phpapp01.pdf

cpu sechduling
cpu sechduling cpu sechduling
cpu sechduling gopi7
 
Cpu scheduling(suresh)
Cpu scheduling(suresh)Cpu scheduling(suresh)
Cpu scheduling(suresh)Nagarajan
 
Ch6
Ch6Ch6
Ch6C.U
 
Scheduling algorithm (chammu)
Scheduling algorithm (chammu)Scheduling algorithm (chammu)
Scheduling algorithm (chammu)Nagarajan
 
Process Scheduling Algorithms.pdf
Process Scheduling Algorithms.pdfProcess Scheduling Algorithms.pdf
Process Scheduling Algorithms.pdfRakibul Rakib
 
Scheduling algo(by HJ)
Scheduling algo(by HJ)Scheduling algo(by HJ)
Scheduling algo(by HJ)Harshit Jain
 
Ch05 cpu-scheduling
Ch05 cpu-schedulingCh05 cpu-scheduling
Ch05 cpu-schedulingNazir Ahmed
 
CPU scheduling
CPU schedulingCPU scheduling
CPU schedulingAmir Khan
 
Window scheduling algorithm
Window scheduling algorithmWindow scheduling algorithm
Window scheduling algorithmBinal Parekh
 
Operating system 29 non preemptive scheduling
Operating system 29 non preemptive schedulingOperating system 29 non preemptive scheduling
Operating system 29 non preemptive schedulingVaibhav Khanna
 
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
 

Ähnlich wie csc4320chapter5-2-101203002830-phpapp01.pdf (20)

Ch05
Ch05Ch05
Ch05
 
cpu sechduling
cpu sechduling cpu sechduling
cpu sechduling
 
Cpu scheduling(suresh)
Cpu scheduling(suresh)Cpu scheduling(suresh)
Cpu scheduling(suresh)
 
Ch6
Ch6Ch6
Ch6
 
CH06.pdf
CH06.pdfCH06.pdf
CH06.pdf
 
CPU Scheduling
CPU SchedulingCPU Scheduling
CPU Scheduling
 
Scheduling algorithm (chammu)
Scheduling algorithm (chammu)Scheduling algorithm (chammu)
Scheduling algorithm (chammu)
 
Process Scheduling Algorithms.pdf
Process Scheduling Algorithms.pdfProcess Scheduling Algorithms.pdf
Process Scheduling Algorithms.pdf
 
Sa by shekhar
Sa by shekharSa by shekhar
Sa by shekhar
 
Scheduling algo(by HJ)
Scheduling algo(by HJ)Scheduling algo(by HJ)
Scheduling algo(by HJ)
 
Ch05 cpu-scheduling
Ch05 cpu-schedulingCh05 cpu-scheduling
Ch05 cpu-scheduling
 
Cpu_sheduling.pptx
Cpu_sheduling.pptxCpu_sheduling.pptx
Cpu_sheduling.pptx
 
CPU scheduling
CPU schedulingCPU scheduling
CPU scheduling
 
CPU Scheduling.pdf
CPU Scheduling.pdfCPU Scheduling.pdf
CPU Scheduling.pdf
 
Window scheduling algorithm
Window scheduling algorithmWindow scheduling algorithm
Window scheduling algorithm
 
Cpu Scheduling Galvin
Cpu Scheduling GalvinCpu Scheduling Galvin
Cpu Scheduling Galvin
 
CPU Scheduling Part-II.pdf
CPU Scheduling Part-II.pdfCPU Scheduling Part-II.pdf
CPU Scheduling Part-II.pdf
 
Operating system 29 non preemptive scheduling
Operating system 29 non preemptive schedulingOperating system 29 non preemptive scheduling
Operating system 29 non preemptive scheduling
 
OS ASSIGNMENT.pptx
OS ASSIGNMENT.pptxOS ASSIGNMENT.pptx
OS ASSIGNMENT.pptx
 
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
 

Kürzlich hochgeladen

On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxVishalSingh1417
 
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesEnergy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesShubhangi Sonawane
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Shubhangi Sonawane
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
Role Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxRole Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxNikitaBankoti2
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxVishalSingh1417
 
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIFood Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIShubhangi Sonawane
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 

Kürzlich hochgeladen (20)

On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesEnergy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Role Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxRole Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptx
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIFood Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 

csc4320chapter5-2-101203002830-phpapp01.pdf

  • 1. Shri Ramswaroop Memorial University NAME – VAIBHAV SAHU ROLL NO. – 202110101110079 COURSE – B.TECH CS-43 SUBJECT – OPERATING SYSTEMS SUBJECT CODE- BCS4022 SESSION – 2023-24 SUBMITTED TO - NEERAJ KUMAR SIR SUBMITTED BY- VAIBHAV SAHU
  • 2. Scheduling Criteria CPU utilization – keep the CPU as busy as possible (from 0% to 100%) 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
  • 3. Optimization Criteria  Max CPU utilization Max throughput Min turnaround time Min waiting time Min Response time    
  • 4. Scheduling Algorithems  First Come First Serve Scheduling Shortest Job First Scheduling Priority Scheduling Round-Robin Scheduling Multilevel Queue Scheduling Multilevel Feedback-Queue Scheduling     
  • 5. First Come First Serve Scheduling (FCFS) Process Burst time P1 24 P2 3 P2 3
  • 6. First Come First Serve Scheduling  The average of waiting time in this policy is usually quite long  Waiting time for P1=0; P2=24; P3=27 Average waiting time= (0+24+27)/3=17 
  • 7. First Come First Serve Scheduling  Suppose we change the order of arriving job P2, P3, P1
  • 8. First Come First Serve Scheduling  Consider if we have a CPU-bound process and many I/O-bound processes  There is a convoy effect as all the other processes waiting for one of the big process to get off the CPU  FCFS scheduling algorithm is non-preemptive
  • 9. Short job first scheduling (SJF)  This algorithm associates with each process the length of the processes’ next CPU burst  If there is a tie, FCFS is used In other words, this algorithm can be also regard as shortest-next-cpu-burst algorithm 
  • 10. Short job first scheduling  SJF is optimal – gives minimum average waiting time for a given set of processes
  • 11. Example Processes Burst time P1 6 P2 8 P3 7 P4 3 FCFS average waiting time: (0+6+14+21)/4=10.25 SJF average waiting time: (3+16+9+0)/4=7
  • 12. Short job first scheduling Two schemes: Non-preemptive – 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)
  • 13. Short job first scheduling- Non-preemptive
  • 14. Short job first scheduling- Preemptive
  • 15. Priority Scheduling A priority number (integer) is associated with each process The CPU is allocated to the process with the highest priority (smallest integer ≡ highest priority)   Preemptive Non-preemptive SJF is a special priority scheduling where priority is the predicted next CPU burst time, so that it can decide the priority
  • 16. Priority Scheduling Processes Burst time Priority Arrival time P1 10 3 P2 1 1 P3 2 4 P4 1 5 P5 5 2 The average waiting time=(6+0+16+18+1)/5=8.2
  • 17. Priority Scheduling Processes Burst time Priority Arrival time P1 10 3 0.0 P2 1 1 1.0 P3 2 4 2.0 P4 1 5 3.0 P5 5 2 4.0 Gantt chart for both preemptive and non- preemptive, also waiting time
  • 18. Priority Scheduling Problem : Starvation – low priority processes may never execute Solution : Aging – as time progresses increase the priority of the process
  • 19. Round-Robin Scheduling  The Round-Robin is designed especially for time sharing systems. It is similar FCFS but add preemption concept A small unit of time, called time quantum, is defined  
  • 20. 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.
  • 22. Round-Robin Scheduling  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.
  • 23. Round-Robin Scheduling Performance  q large => FIFO  q small => q must be large with respect to context switch, otherwise overhead is too high  Typically, higher average turnaround than SJF, but better response
  • 25. Multilevel Queue Ready queue is partitioned into separate queues:  foreground (interactive)  background (batch) Each queue has its own scheduling algorithm foreground – RR background – FCFS
  • 26. Multilevel Queue example  Foreground P1 53 (RR interval:20) P2 17 P3 42  Background P4 30 (FCFS) P5 20
  • 27. Multilevel Queue 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 
  • 29. 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.
  • 31. Multilevel Feedback Queue  P1 40 P2 35 P3 15  