SlideShare a Scribd company logo
1 of 8
Download to read offline
Slide 1 
CPU Scheduling
 Classification of CPU Scheduling
 Performance Criteria of Good Scheduler
 CPU Scheduling Algorithms
 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
Slide 2 
*Property of STI J0024
CPU scheduling may be classified as:
 Non‐preemptive scheduling
CPU scheduling is non‐preemptive if once the CPU has been assigned to a 
process and the process starts executing, the CPU cannot be taken away from 
that process.
 Preemptive scheduling
In preemptive CPU scheduling, even though the CPU has been assigned to a 
process and the process is already executing, the CPU scheduler may decide to 
assign the CPU to another process in the ready queue.
 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
Slide 3 
*Property of STI J0024
A good scheduler should optimize the following performance criteria:
 CPU utilization
 Throughput
 Turnaround time
 Response time
 Waiting time
 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
Slide 4 
*Property of STI J0024
The different CPU scheduling algorithms are:
 First‐Come, First‐Served Algorithm
 Shortest Process First Algorithm
 Shortest Remaining Time First Algorithm
 Round Robin Algorithm
 Priority Scheduling
 Multilevel Feedback Queues
 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
Slide 5 
*Property of STI J0024
First‐Come, First‐Served Algorithm (FCFS)
‐ the one that enters the Ready queue first gets to execute at the CPU first
a.
b.
c.
A
0 8
A
0
B
8 12
A
0
B C
8 12 17
 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
Slide 6 
*Property of STI J0024
First‐Come, First‐Served Algorithm (FCFS)
d.
e.
WTA = 0 – 0 = 0 ms
WTB = 8 – 3 = 5 ms
WTC = 12 – 4 = 8 ms
WTD = 17 – 6 = 11 ms
WTE = 20 – 10 = 10 ms
The average waiting time is
(0 + 5 + 8 + 11 + 10)/5 = 34/5 = 6.8 ms
A
0
B C D
8 12 17 20
A
0
B C D
8 12 17 20
E
22
 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
Slide 7 
*Property of STI J0024
First‐Come, First‐Served Algorithm (FCFS)
TAA = 8 ‐ 0= 8 ms
TAB = 12 ‐ 3 = 9 ms
TAC = 17 ‐ 4 = 13 ms
TAD = 20 ‐ 6 = 14 ms
TAE = 22 ‐ 10 = 12 ms
The average turnaround time is
(8 + 9 + 13 + 14 + 12)/5 = 56/5 = 11.2 ms
 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
Slide 8 
*Property of STI J0024
Shortest Process First Algorithm (SPF)
‐ the process with the shortest CPU burst
a.
b.
c.
A
0 8
A
0
D
8 11
A
0
D
8 11 13
E
 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
Slide 9 
*Property of STI J0024
Shortest Process First Algorithm (SPF)
d.
e.
WTA = 0 – 0 = 0 ms
WTB = 13 – 3 = 10 ms
WTC = 17 – 4 = 13 ms
WTD = 8 – 6 = 2 ms
WTE = 11 – 10 = 1 ms
The average waiting time is
(0 + 10 + 13 + 2 + 1)/5 = 26/5 = 5.2 ms
A
0
BD
8 11 13 17
E
A
0
B CD
8 11 13 17
E
22
 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
Slide 10 
*Property of STI J0024
Shortest Process First Algorithm (SPF)
TAA = 8‐ 0 = 8 ms
TAB = 17 ‐ 3 = 14 ms
TAC = 22 ‐ 4 = 18 ms
TAD = 11 ‐ 6 = 5 ms
TAE = 13 ‐ 10 = 3 ms
The average turnaround time is
(8 + 14 + 18 + 5 + 3)/5 = 48/5 = 9.6 ms
 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
Slide 11 
*Property of STI J0024
Shortest Remaining Time First Algorithm (SRTF)
‐ the preemptive version of SPF
a.
b.
c.
d.
Process ID Arrival Time CPU Burst
A 0 8
B 3 4
C 4 5
D 6 3
E 10 2
0
A
0
A
3
B
0
B
7
A
3
0
B
7
DA
3
 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
Slide 12 
*Property of STI J0024
Shortest Remaining Time First Algorithm (SRTF)
e.
f.
g.
h.
WTA = (0 – 0) + (12 – 3) = 9 ms
WTB = 3 – 3 = 0 ms
WTC = 17 – 4 = 13 ms
WTD = 7 – 6 = 1 ms
WTE = 10 – 10 = 0 ms
The average waiting time is
(9 + 0 + 13 + 1 + 0)/5 = 23/5 = 4.6 ms
0
B D
7 10
A
3
0
B D
7 10 12
EA
3
A
0
B D
7 10 12 17
EA
3
A
0
B CD
7 10 12 17
E
22
A
3
 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
Slide 13 
*Property of STI J0024
Shortest Remaining Time First Algorithm (SRTF)
TAA = 17 ‐ 0= 17 ms
TAB = 7 ‐ 3 = 4 ms
TAC = 22 ‐ 4 = 18 ms
TAD = 10 ‐ 6 = 4 ms
TAE = 12 ‐ 10 = 2 ms
The average turnaround time is
(17 + 4 + 18 + 4 + 2)/5 = 45/5 = 9.0 ms
 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
Slide 14 
*Property of STI J0024
Round Robin Algorithm (RR)
‐ the process are selected on a first‐come, first‐served basis. However, each 
process is given a time limit to execute at the CPU.
Assume a time quantum of 3 ms.
a. 
b.
Process ID Arrival Time CPU Burst
A 0 8
B 3 4
C 4 5
D 6 3
E 10 2
0
A
3
0
B
6
A
3
 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
Slide 15 
*Property of STI J0024
Round Robin Algorithm (RR)
c. 
d.
e
f.
g.
h
i.
0
B A
6 9
A
3
0
B A
6 9 12
CA
3
D
0
B A
6 9 12 15
CA
3
D
0
B A
6 9 12 15
CA
3
B
16
D
0
B A
6 9 12 15
CA
3
B
16
A
18
D
0
B A
6 9 12 15
CA
3
B
16
A
18
E
20
D
0
B CA
6 9 12 15
C
22
A
3
B
16
A
18
E
20
 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
Slide 16 
*Property of STI J0024
Round Robin Algorithm (RR)
WTA = (0 – 0) + (6 – 3) + (16 – 9) = 10 ms
WTB = (3 – 3) + (15 – 6) = 9 ms
WTC = (9 – 4) + (20 – 12) = 13 ms
WTD = 12 – 6 = 6 ms
WTE = 18 – 10 = 8 ms
The average waiting time is
(10 + 9 + 13 + 6 + 8)/5 = 46/5 = 9.2 ms
 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
Slide 17 
*Property of STI J0024
Round Robin Algorithm (RR)
TAA = 18 ‐ 6= 18 ms
TAB = 16 ‐ 3 = 13 ms
TAC = 22 ‐ 4 = 18 ms
TAD = 15 ‐ 6 = 9 ms
TAE = 20 ‐ 10 = 10 ms
The average turnaround time is
(18 + 13 + 18 + 9 + 10)/5 = 68/5 = 13.6 ms
 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
Slide 18 
*Property of STI J0024
Priority Scheduling
‐ Each process is assigned a priority and the CPU scheduler selects the process in 
the ready queue with the highest priority to execute next.
Using the non‐preemptive priority algorithm:
a. 
b.
Process ID Arrival
Time
CPU Burst Priority
A 0 8 4
B 3 4 3
C 4 5 1
D 6 3 2
E 10 2 2
A
0 8
A
0
C
8 13
 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
Slide 19 
*Property of STI J0024
Priority Scheduling
c. 
d.
e.
WTA = 0 – 0 = 0 ms
WTB = 18 – 3 = 15 ms
WTC = 8 – 4 = 4 ms
WTD = 13 – 6 = 7 ms
WTE = 16 – 10 = 6 ms
The average waiting time is
(0 + 15 + 4 + 7 + 6)/5 = 32/5 = 6.4 ms
A
0
C D
8 13 16
A
0
C D
8 13 16 18
E
A
0
BC D
8 13 16 18
E
22
 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
Slide 20 
*Property of STI J0024
Priority Scheduling
TAA = 8 ‐ 0= 8 ms
TAB = 22 – 3 = 19 ms
TAC = 13 ‐ 4 = 9 ms
TAD = 16 ‐ 6 = 10 ms
TAE = 18 ‐ 10 = 8 ms
The average turnaround time is
(8 + 19 + 9 + 10 + 8)/5 = 54/5 = 10.8 ms
 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
Slide 21 
*Property of STI J0024
Priority Scheduling
Using the preemptive priority algorithm:
a. 
b.
c. 
d.
Process ID Arrival
Time
CPU Burst Priority
A 0 8 4
B 3 4 3
C 4 5 1
D 6 3 2
E 10 2 2
0
A
0
BA
3
0
B C
4 9
A
3
0
B C
4 9
A
3
D
 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
Slide 22 
*Property of STI J0024
Priority Scheduling
e. 
f.
WTA = (0 – 0) + (17 – 3) = 14 ms
WTB = (3 – 3) + (14 ‐ 4) = 10 ms
WTC = (4 – 4) = 0 ms
WTD = (9 – 6) = 3 ms
WTE = (12 – 10) = 2 ms
The average waiting time is
(14 + 10 + 0 + 3 + 2)/5 = 29/5 = 5.8 ms
0
B C D
4 9 12
A
3
A
0
B C D
4 9 12 14
E
22
A
3
B
17
 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
Slide 23 
*Property of STI J0024
Priority Scheduling
TAA = 22 – 0 = 22 ms
TAB = 17 ‐ 3 = 14 ms
TAC = 9 ‐ 4 = 5 ms
TAD = 12 ‐ 6 = 6 ms
TAE = 14 ‐ 10 = 4 ms
The average turnaround time is
(22 + 14 + 5 + 6 + 4)/5 = 51/5 = 10.2 ms
 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
Slide 24 
*Property of STI J0024
Multilevel Feedback Queues
Q0All processes enter
the queuing network
at the rear of the
highest priority
queue
Processes that
finish executing or
request for an I/O
operation within the
given time slice
leave the queuing
network
FCFS (time slice = 10 ms)
Q1
FCFS (time slice = 20 ms)
Processes that do not finish executing
within the given time slice move to the next
lower-priority queue
Processes that
finish executing or
request for an I/O
operation within the
given time slice
leave the queuing
network
.
.
.
Qn
RR
Processes that do not finish executing
within the given time slice move to the next
lower-priority queue
Q2
FCFS (time slice = 30 ms)
Processes that
finish executing or
request for an I/O
operation within the
given time slice
leave the queuing
network
Processes that
finish executing or
request for an I/O
operation within the
given time slice
leave the queuing
network
 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
___________________________________ 
 

More Related Content

What's hot

Topic 4 Massage Therapy handout
Topic 4 Massage Therapy handoutTopic 4 Massage Therapy handout
Topic 4 Massage Therapy handoutNorton Healthcare
 
Plantilla mensual castellano
Plantilla mensual castellanoPlantilla mensual castellano
Plantilla mensual castellanoNai Von Cake
 
Plantilla mensual galego
Plantilla mensual galegoPlantilla mensual galego
Plantilla mensual galegoNai Von Cake
 
Science (diversity in living organisms) (2)
Science (diversity in living organisms) (2)Science (diversity in living organisms) (2)
Science (diversity in living organisms) (2)Siddharth Munavalli
 
Planificador mensual
Planificador mensualPlanificador mensual
Planificador mensualNai Von Cake
 
Assessment notes
Assessment notesAssessment notes
Assessment notesctd515
 
Mintzalaguna.Pertsonaia
Mintzalaguna.PertsonaiaMintzalaguna.Pertsonaia
Mintzalaguna.Pertsonaiagarbiskola
 
Maths paper 2
Maths paper 2Maths paper 2
Maths paper 2AATHI1234
 
Transformative Learning
Transformative LearningTransformative Learning
Transformative Learningctd515
 
Material properties 1 general
Material properties 1   generalMaterial properties 1   general
Material properties 1 generalJim Finn
 
Year 13 sports studies fatigue technical-exam
Year 13 sports studies   fatigue technical-examYear 13 sports studies   fatigue technical-exam
Year 13 sports studies fatigue technical-examdcalevelpe
 
Capacity of facility
Capacity of facilityCapacity of facility
Capacity of facilityBaijan
 
Presentation handout edtc 640
Presentation handout  edtc 640Presentation handout  edtc 640
Presentation handout edtc 640debnatb
 
Human Side of Online Learning
Human Side of Online LearningHuman Side of Online Learning
Human Side of Online Learningctd515
 
Zurich Residential Strata PDS (Product Disclosure Statement / Policy Wording)
Zurich Residential Strata PDS (Product Disclosure Statement / Policy Wording)Zurich Residential Strata PDS (Product Disclosure Statement / Policy Wording)
Zurich Residential Strata PDS (Product Disclosure Statement / Policy Wording)InsuranceRateMonitors
 

What's hot (19)

Topic 4 Massage Therapy handout
Topic 4 Massage Therapy handoutTopic 4 Massage Therapy handout
Topic 4 Massage Therapy handout
 
Plantilla mensual castellano
Plantilla mensual castellanoPlantilla mensual castellano
Plantilla mensual castellano
 
Plantilla mensual galego
Plantilla mensual galegoPlantilla mensual galego
Plantilla mensual galego
 
Science (diversity in living organisms) (2)
Science (diversity in living organisms) (2)Science (diversity in living organisms) (2)
Science (diversity in living organisms) (2)
 
Planificador mensual
Planificador mensualPlanificador mensual
Planificador mensual
 
Assessment notes
Assessment notesAssessment notes
Assessment notes
 
Study guide Landmarks
Study guide LandmarksStudy guide Landmarks
Study guide Landmarks
 
Landmarks & attraction
Landmarks & attractionLandmarks & attraction
Landmarks & attraction
 
Mintzalaguna.Pertsonaia
Mintzalaguna.PertsonaiaMintzalaguna.Pertsonaia
Mintzalaguna.Pertsonaia
 
Maths paper 2
Maths paper 2Maths paper 2
Maths paper 2
 
Transformative Learning
Transformative LearningTransformative Learning
Transformative Learning
 
Diapositiva 1
Diapositiva 1Diapositiva 1
Diapositiva 1
 
Material properties 1 general
Material properties 1   generalMaterial properties 1   general
Material properties 1 general
 
Year 13 sports studies fatigue technical-exam
Year 13 sports studies   fatigue technical-examYear 13 sports studies   fatigue technical-exam
Year 13 sports studies fatigue technical-exam
 
Casa sem dengue
Casa sem dengueCasa sem dengue
Casa sem dengue
 
Capacity of facility
Capacity of facilityCapacity of facility
Capacity of facility
 
Presentation handout edtc 640
Presentation handout  edtc 640Presentation handout  edtc 640
Presentation handout edtc 640
 
Human Side of Online Learning
Human Side of Online LearningHuman Side of Online Learning
Human Side of Online Learning
 
Zurich Residential Strata PDS (Product Disclosure Statement / Policy Wording)
Zurich Residential Strata PDS (Product Disclosure Statement / Policy Wording)Zurich Residential Strata PDS (Product Disclosure Statement / Policy Wording)
Zurich Residential Strata PDS (Product Disclosure Statement / Policy Wording)
 

Similar to 05 lcd slide handout 1 - CPU SCHEDULING

08 final tv drama revision session
08 final tv drama revision session08 final tv drama revision session
08 final tv drama revision sessionibz10
 
01 lcd slide_handout_2
01 lcd slide_handout_201 lcd slide_handout_2
01 lcd slide_handout_2Coleen Gatus
 
Social Media Audit - Grocery Stores
Social Media Audit - Grocery StoresSocial Media Audit - Grocery Stores
Social Media Audit - Grocery StoresZASocial Media
 
Year 13 sports studies exam 1
Year 13 sports studies   exam 1Year 13 sports studies   exam 1
Year 13 sports studies exam 1dcalevelpe
 
Assignment #10 Market Structures 1 Perfect Competition and .docx
Assignment #10 Market Structures 1 Perfect Competition and .docxAssignment #10 Market Structures 1 Perfect Competition and .docx
Assignment #10 Market Structures 1 Perfect Competition and .docxfredharris32
 
Il metodo A3 e kata coaching - Roberto Ronzani
Il metodo A3 e kata coaching - Roberto RonzaniIl metodo A3 e kata coaching - Roberto Ronzani
Il metodo A3 e kata coaching - Roberto RonzaniPMexpo
 
John Lynch's Resume 2015 LinkedIn
John Lynch's Resume 2015 LinkedInJohn Lynch's Resume 2015 LinkedIn
John Lynch's Resume 2015 LinkedInJohn Lynch
 
Test1foundation nimby
Test1foundation nimbyTest1foundation nimby
Test1foundation nimbySusie Nash
 
Beneficios de los arboles
Beneficios de los arbolesBeneficios de los arboles
Beneficios de los arbolesMirian Cruz
 
Literary elements
Literary elementsLiterary elements
Literary elementslkonrad56
 
Les instal·lacions de l'habitatge
Les instal·lacions de l'habitatgeLes instal·lacions de l'habitatge
Les instal·lacions de l'habitatgeEscola Seda
 
годишни времиња р.л.
годишни времиња р.л.годишни времиња р.л.
годишни времиња р.л.Nela S Nikovska
 
Q 1-3 Chapter 1Q 4 Chapter 2Q 5-6 Chapter 3Q 7- 8 Ch.docx
Q 1-3  Chapter 1Q 4      Chapter 2Q 5-6  Chapter 3Q 7- 8  Ch.docxQ 1-3  Chapter 1Q 4      Chapter 2Q 5-6  Chapter 3Q 7- 8  Ch.docx
Q 1-3 Chapter 1Q 4 Chapter 2Q 5-6 Chapter 3Q 7- 8 Ch.docxmakdul
 
Passando da letra bastão para a cursiva alexandra borges
Passando da letra bastão para a cursiva alexandra borgesPassando da letra bastão para a cursiva alexandra borges
Passando da letra bastão para a cursiva alexandra borgesSusana Felix
 
Treinando a escrita das palavras
Treinando a escrita das palavrasTreinando a escrita das palavras
Treinando a escrita das palavrasSonia Elisabete
 

Similar to 05 lcd slide handout 1 - CPU SCHEDULING (20)

08 final tv drama revision session
08 final tv drama revision session08 final tv drama revision session
08 final tv drama revision session
 
01 lcd slide_handout_2
01 lcd slide_handout_201 lcd slide_handout_2
01 lcd slide_handout_2
 
Social Media Audit - Grocery Stores
Social Media Audit - Grocery StoresSocial Media Audit - Grocery Stores
Social Media Audit - Grocery Stores
 
Year 13 sports studies exam 1
Year 13 sports studies   exam 1Year 13 sports studies   exam 1
Year 13 sports studies exam 1
 
Assignment #10 Market Structures 1 Perfect Competition and .docx
Assignment #10 Market Structures 1 Perfect Competition and .docxAssignment #10 Market Structures 1 Perfect Competition and .docx
Assignment #10 Market Structures 1 Perfect Competition and .docx
 
Chart Signs of spring
Chart Signs of springChart Signs of spring
Chart Signs of spring
 
Il metodo A3 e kata coaching - Roberto Ronzani
Il metodo A3 e kata coaching - Roberto RonzaniIl metodo A3 e kata coaching - Roberto Ronzani
Il metodo A3 e kata coaching - Roberto Ronzani
 
John Lynch's Resume 2015 LinkedIn
John Lynch's Resume 2015 LinkedInJohn Lynch's Resume 2015 LinkedIn
John Lynch's Resume 2015 LinkedIn
 
Test1foundation nimby
Test1foundation nimbyTest1foundation nimby
Test1foundation nimby
 
Beneficios de los arboles
Beneficios de los arbolesBeneficios de los arboles
Beneficios de los arboles
 
Literary elements
Literary elementsLiterary elements
Literary elements
 
Les instal·lacions de l'habitatge
Les instal·lacions de l'habitatgeLes instal·lacions de l'habitatge
Les instal·lacions de l'habitatge
 
годишни времиња р.л.
годишни времиња р.л.годишни времиња р.л.
годишни времиња р.л.
 
Q 1-3 Chapter 1Q 4 Chapter 2Q 5-6 Chapter 3Q 7- 8 Ch.docx
Q 1-3  Chapter 1Q 4      Chapter 2Q 5-6  Chapter 3Q 7- 8  Ch.docxQ 1-3  Chapter 1Q 4      Chapter 2Q 5-6  Chapter 3Q 7- 8  Ch.docx
Q 1-3 Chapter 1Q 4 Chapter 2Q 5-6 Chapter 3Q 7- 8 Ch.docx
 
Modales ejercicio
Modales ejercicioModales ejercicio
Modales ejercicio
 
Mock
MockMock
Mock
 
Neri - CV 2014
Neri - CV 2014Neri - CV 2014
Neri - CV 2014
 
Flags of Africa - draw
Flags of Africa - drawFlags of Africa - draw
Flags of Africa - draw
 
Passando da letra bastão para a cursiva alexandra borges
Passando da letra bastão para a cursiva alexandra borgesPassando da letra bastão para a cursiva alexandra borges
Passando da letra bastão para a cursiva alexandra borges
 
Treinando a escrita das palavras
Treinando a escrita das palavrasTreinando a escrita das palavras
Treinando a escrita das palavras
 

More from Anne Lee

Week 17 slides 1 7 multidimensional, parallel, and distributed database
Week 17 slides 1 7 multidimensional, parallel, and distributed databaseWeek 17 slides 1 7 multidimensional, parallel, and distributed database
Week 17 slides 1 7 multidimensional, parallel, and distributed databaseAnne Lee
 
Data mining
Data miningData mining
Data miningAnne Lee
 
Data warehousing
Data warehousingData warehousing
Data warehousingAnne Lee
 
Database backup and recovery
Database backup and recoveryDatabase backup and recovery
Database backup and recoveryAnne Lee
 
Database monitoring and performance management
Database monitoring and performance managementDatabase monitoring and performance management
Database monitoring and performance managementAnne Lee
 
transportation and assignment models
transportation and assignment modelstransportation and assignment models
transportation and assignment modelsAnne Lee
 
Database Security Slide Handout
Database Security Slide HandoutDatabase Security Slide Handout
Database Security Slide HandoutAnne Lee
 
Database Security Handout
Database Security HandoutDatabase Security Handout
Database Security HandoutAnne Lee
 
Database Security - IG
Database Security - IGDatabase Security - IG
Database Security - IGAnne Lee
 
03 laboratory exercise 1 - WORKING WITH CTE
03 laboratory exercise 1 - WORKING WITH CTE03 laboratory exercise 1 - WORKING WITH CTE
03 laboratory exercise 1 - WORKING WITH CTEAnne Lee
 
02 laboratory exercise 1 - RETRIEVING DATA FROM SEVERAL TABLES
02 laboratory exercise 1 - RETRIEVING DATA FROM SEVERAL TABLES02 laboratory exercise 1 - RETRIEVING DATA FROM SEVERAL TABLES
02 laboratory exercise 1 - RETRIEVING DATA FROM SEVERAL TABLESAnne Lee
 
01 laboratory exercise 1 - DESIGN A SIMPLE DATABASE APPLICATION
01 laboratory exercise 1 - DESIGN A SIMPLE DATABASE APPLICATION01 laboratory exercise 1 - DESIGN A SIMPLE DATABASE APPLICATION
01 laboratory exercise 1 - DESIGN A SIMPLE DATABASE APPLICATIONAnne Lee
 
Indexes - INSTRUCTOR'S GUIDE
Indexes - INSTRUCTOR'S GUIDEIndexes - INSTRUCTOR'S GUIDE
Indexes - INSTRUCTOR'S GUIDEAnne Lee
 
07 ohp slides 1 - INDEXES
07 ohp slides 1 - INDEXES07 ohp slides 1 - INDEXES
07 ohp slides 1 - INDEXESAnne Lee
 
07 ohp slide handout 1 - INDEXES
07 ohp slide handout 1 - INDEXES07 ohp slide handout 1 - INDEXES
07 ohp slide handout 1 - INDEXESAnne Lee
 
Wk 16 ses 43 45 makrong kasanayan sa pagsusulat
Wk 16 ses 43 45 makrong kasanayan sa pagsusulatWk 16 ses 43 45 makrong kasanayan sa pagsusulat
Wk 16 ses 43 45 makrong kasanayan sa pagsusulatAnne Lee
 
Wk 15 ses 40 42 makrong kasanayan sa pagbabasa
Wk 15 ses 40 42 makrong kasanayan sa pagbabasaWk 15 ses 40 42 makrong kasanayan sa pagbabasa
Wk 15 ses 40 42 makrong kasanayan sa pagbabasaAnne Lee
 
Wk 13 ses 35 37 makrong kasanayan sa pagsasalita
Wk 13 ses 35 37 makrong kasanayan sa pagsasalitaWk 13 ses 35 37 makrong kasanayan sa pagsasalita
Wk 13 ses 35 37 makrong kasanayan sa pagsasalitaAnne Lee
 
Wk 12 ses 32 34 makrong kasanayan sa pakikinig
Wk 12 ses 32 34 makrong kasanayan sa pakikinigWk 12 ses 32 34 makrong kasanayan sa pakikinig
Wk 12 ses 32 34 makrong kasanayan sa pakikinigAnne Lee
 
Wk 11 ses 29 31 konseptong pangkomunikasyon - FILIPINO 1
Wk 11 ses 29 31 konseptong pangkomunikasyon - FILIPINO 1Wk 11 ses 29 31 konseptong pangkomunikasyon - FILIPINO 1
Wk 11 ses 29 31 konseptong pangkomunikasyon - FILIPINO 1Anne Lee
 

More from Anne Lee (20)

Week 17 slides 1 7 multidimensional, parallel, and distributed database
Week 17 slides 1 7 multidimensional, parallel, and distributed databaseWeek 17 slides 1 7 multidimensional, parallel, and distributed database
Week 17 slides 1 7 multidimensional, parallel, and distributed database
 
Data mining
Data miningData mining
Data mining
 
Data warehousing
Data warehousingData warehousing
Data warehousing
 
Database backup and recovery
Database backup and recoveryDatabase backup and recovery
Database backup and recovery
 
Database monitoring and performance management
Database monitoring and performance managementDatabase monitoring and performance management
Database monitoring and performance management
 
transportation and assignment models
transportation and assignment modelstransportation and assignment models
transportation and assignment models
 
Database Security Slide Handout
Database Security Slide HandoutDatabase Security Slide Handout
Database Security Slide Handout
 
Database Security Handout
Database Security HandoutDatabase Security Handout
Database Security Handout
 
Database Security - IG
Database Security - IGDatabase Security - IG
Database Security - IG
 
03 laboratory exercise 1 - WORKING WITH CTE
03 laboratory exercise 1 - WORKING WITH CTE03 laboratory exercise 1 - WORKING WITH CTE
03 laboratory exercise 1 - WORKING WITH CTE
 
02 laboratory exercise 1 - RETRIEVING DATA FROM SEVERAL TABLES
02 laboratory exercise 1 - RETRIEVING DATA FROM SEVERAL TABLES02 laboratory exercise 1 - RETRIEVING DATA FROM SEVERAL TABLES
02 laboratory exercise 1 - RETRIEVING DATA FROM SEVERAL TABLES
 
01 laboratory exercise 1 - DESIGN A SIMPLE DATABASE APPLICATION
01 laboratory exercise 1 - DESIGN A SIMPLE DATABASE APPLICATION01 laboratory exercise 1 - DESIGN A SIMPLE DATABASE APPLICATION
01 laboratory exercise 1 - DESIGN A SIMPLE DATABASE APPLICATION
 
Indexes - INSTRUCTOR'S GUIDE
Indexes - INSTRUCTOR'S GUIDEIndexes - INSTRUCTOR'S GUIDE
Indexes - INSTRUCTOR'S GUIDE
 
07 ohp slides 1 - INDEXES
07 ohp slides 1 - INDEXES07 ohp slides 1 - INDEXES
07 ohp slides 1 - INDEXES
 
07 ohp slide handout 1 - INDEXES
07 ohp slide handout 1 - INDEXES07 ohp slide handout 1 - INDEXES
07 ohp slide handout 1 - INDEXES
 
Wk 16 ses 43 45 makrong kasanayan sa pagsusulat
Wk 16 ses 43 45 makrong kasanayan sa pagsusulatWk 16 ses 43 45 makrong kasanayan sa pagsusulat
Wk 16 ses 43 45 makrong kasanayan sa pagsusulat
 
Wk 15 ses 40 42 makrong kasanayan sa pagbabasa
Wk 15 ses 40 42 makrong kasanayan sa pagbabasaWk 15 ses 40 42 makrong kasanayan sa pagbabasa
Wk 15 ses 40 42 makrong kasanayan sa pagbabasa
 
Wk 13 ses 35 37 makrong kasanayan sa pagsasalita
Wk 13 ses 35 37 makrong kasanayan sa pagsasalitaWk 13 ses 35 37 makrong kasanayan sa pagsasalita
Wk 13 ses 35 37 makrong kasanayan sa pagsasalita
 
Wk 12 ses 32 34 makrong kasanayan sa pakikinig
Wk 12 ses 32 34 makrong kasanayan sa pakikinigWk 12 ses 32 34 makrong kasanayan sa pakikinig
Wk 12 ses 32 34 makrong kasanayan sa pakikinig
 
Wk 11 ses 29 31 konseptong pangkomunikasyon - FILIPINO 1
Wk 11 ses 29 31 konseptong pangkomunikasyon - FILIPINO 1Wk 11 ses 29 31 konseptong pangkomunikasyon - FILIPINO 1
Wk 11 ses 29 31 konseptong pangkomunikasyon - FILIPINO 1
 

Recently uploaded

Buds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in NoidaBuds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in Noidabntitsolutionsrishis
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...OnePlan Solutions
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtimeandrehoraa
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odishasmiwainfosol
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)jennyeacort
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....kzayra69
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfFerryKemperman
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
How to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdfHow to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdfLivetecs LLC
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfStefano Stabellini
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceBrainSell Technologies
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Velvetech LLC
 

Recently uploaded (20)

Buds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in NoidaBuds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdf
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
How to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdfHow to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdf
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdf
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. Salesforce
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
 

05 lcd slide handout 1 - CPU SCHEDULING

  • 1. Slide 1  CPU Scheduling  Classification of CPU Scheduling  Performance Criteria of Good Scheduler  CPU Scheduling Algorithms   ___________________________________  ___________________________________  ___________________________________  ___________________________________  ___________________________________  ___________________________________  ___________________________________  Slide 2  *Property of STI J0024 CPU scheduling may be classified as:  Non‐preemptive scheduling CPU scheduling is non‐preemptive if once the CPU has been assigned to a  process and the process starts executing, the CPU cannot be taken away from  that process.  Preemptive scheduling In preemptive CPU scheduling, even though the CPU has been assigned to a  process and the process is already executing, the CPU scheduler may decide to  assign the CPU to another process in the ready queue.   ___________________________________  ___________________________________  ___________________________________  ___________________________________  ___________________________________  ___________________________________  ___________________________________  Slide 3  *Property of STI J0024 A good scheduler should optimize the following performance criteria:  CPU utilization  Throughput  Turnaround time  Response time  Waiting time   ___________________________________  ___________________________________  ___________________________________  ___________________________________  ___________________________________  ___________________________________  ___________________________________ 
  • 2. Slide 4  *Property of STI J0024 The different CPU scheduling algorithms are:  First‐Come, First‐Served Algorithm  Shortest Process First Algorithm  Shortest Remaining Time First Algorithm  Round Robin Algorithm  Priority Scheduling  Multilevel Feedback Queues   ___________________________________  ___________________________________  ___________________________________  ___________________________________  ___________________________________  ___________________________________  ___________________________________  Slide 5  *Property of STI J0024 First‐Come, First‐Served Algorithm (FCFS) ‐ the one that enters the Ready queue first gets to execute at the CPU first a. b. c. A 0 8 A 0 B 8 12 A 0 B C 8 12 17   ___________________________________  ___________________________________  ___________________________________  ___________________________________  ___________________________________  ___________________________________  ___________________________________  Slide 6  *Property of STI J0024 First‐Come, First‐Served Algorithm (FCFS) d. e. WTA = 0 – 0 = 0 ms WTB = 8 – 3 = 5 ms WTC = 12 – 4 = 8 ms WTD = 17 – 6 = 11 ms WTE = 20 – 10 = 10 ms The average waiting time is (0 + 5 + 8 + 11 + 10)/5 = 34/5 = 6.8 ms A 0 B C D 8 12 17 20 A 0 B C D 8 12 17 20 E 22   ___________________________________  ___________________________________  ___________________________________  ___________________________________  ___________________________________  ___________________________________  ___________________________________ 
  • 3. Slide 7  *Property of STI J0024 First‐Come, First‐Served Algorithm (FCFS) TAA = 8 ‐ 0= 8 ms TAB = 12 ‐ 3 = 9 ms TAC = 17 ‐ 4 = 13 ms TAD = 20 ‐ 6 = 14 ms TAE = 22 ‐ 10 = 12 ms The average turnaround time is (8 + 9 + 13 + 14 + 12)/5 = 56/5 = 11.2 ms   ___________________________________  ___________________________________  ___________________________________  ___________________________________  ___________________________________  ___________________________________  ___________________________________  Slide 8  *Property of STI J0024 Shortest Process First Algorithm (SPF) ‐ the process with the shortest CPU burst a. b. c. A 0 8 A 0 D 8 11 A 0 D 8 11 13 E   ___________________________________  ___________________________________  ___________________________________  ___________________________________  ___________________________________  ___________________________________  ___________________________________  Slide 9  *Property of STI J0024 Shortest Process First Algorithm (SPF) d. e. WTA = 0 – 0 = 0 ms WTB = 13 – 3 = 10 ms WTC = 17 – 4 = 13 ms WTD = 8 – 6 = 2 ms WTE = 11 – 10 = 1 ms The average waiting time is (0 + 10 + 13 + 2 + 1)/5 = 26/5 = 5.2 ms A 0 BD 8 11 13 17 E A 0 B CD 8 11 13 17 E 22   ___________________________________  ___________________________________  ___________________________________  ___________________________________  ___________________________________  ___________________________________  ___________________________________ 
  • 4. Slide 10  *Property of STI J0024 Shortest Process First Algorithm (SPF) TAA = 8‐ 0 = 8 ms TAB = 17 ‐ 3 = 14 ms TAC = 22 ‐ 4 = 18 ms TAD = 11 ‐ 6 = 5 ms TAE = 13 ‐ 10 = 3 ms The average turnaround time is (8 + 14 + 18 + 5 + 3)/5 = 48/5 = 9.6 ms   ___________________________________  ___________________________________  ___________________________________  ___________________________________  ___________________________________  ___________________________________  ___________________________________  Slide 11  *Property of STI J0024 Shortest Remaining Time First Algorithm (SRTF) ‐ the preemptive version of SPF a. b. c. d. Process ID Arrival Time CPU Burst A 0 8 B 3 4 C 4 5 D 6 3 E 10 2 0 A 0 A 3 B 0 B 7 A 3 0 B 7 DA 3   ___________________________________  ___________________________________  ___________________________________  ___________________________________  ___________________________________  ___________________________________  ___________________________________  Slide 12  *Property of STI J0024 Shortest Remaining Time First Algorithm (SRTF) e. f. g. h. WTA = (0 – 0) + (12 – 3) = 9 ms WTB = 3 – 3 = 0 ms WTC = 17 – 4 = 13 ms WTD = 7 – 6 = 1 ms WTE = 10 – 10 = 0 ms The average waiting time is (9 + 0 + 13 + 1 + 0)/5 = 23/5 = 4.6 ms 0 B D 7 10 A 3 0 B D 7 10 12 EA 3 A 0 B D 7 10 12 17 EA 3 A 0 B CD 7 10 12 17 E 22 A 3   ___________________________________  ___________________________________  ___________________________________  ___________________________________  ___________________________________  ___________________________________  ___________________________________ 
  • 5. Slide 13  *Property of STI J0024 Shortest Remaining Time First Algorithm (SRTF) TAA = 17 ‐ 0= 17 ms TAB = 7 ‐ 3 = 4 ms TAC = 22 ‐ 4 = 18 ms TAD = 10 ‐ 6 = 4 ms TAE = 12 ‐ 10 = 2 ms The average turnaround time is (17 + 4 + 18 + 4 + 2)/5 = 45/5 = 9.0 ms   ___________________________________  ___________________________________  ___________________________________  ___________________________________  ___________________________________  ___________________________________  ___________________________________  Slide 14  *Property of STI J0024 Round Robin Algorithm (RR) ‐ the process are selected on a first‐come, first‐served basis. However, each  process is given a time limit to execute at the CPU. Assume a time quantum of 3 ms. a.  b. Process ID Arrival Time CPU Burst A 0 8 B 3 4 C 4 5 D 6 3 E 10 2 0 A 3 0 B 6 A 3   ___________________________________  ___________________________________  ___________________________________  ___________________________________  ___________________________________  ___________________________________  ___________________________________  Slide 15  *Property of STI J0024 Round Robin Algorithm (RR) c.  d. e f. g. h i. 0 B A 6 9 A 3 0 B A 6 9 12 CA 3 D 0 B A 6 9 12 15 CA 3 D 0 B A 6 9 12 15 CA 3 B 16 D 0 B A 6 9 12 15 CA 3 B 16 A 18 D 0 B A 6 9 12 15 CA 3 B 16 A 18 E 20 D 0 B CA 6 9 12 15 C 22 A 3 B 16 A 18 E 20   ___________________________________  ___________________________________  ___________________________________  ___________________________________  ___________________________________  ___________________________________  ___________________________________ 
  • 6. Slide 16  *Property of STI J0024 Round Robin Algorithm (RR) WTA = (0 – 0) + (6 – 3) + (16 – 9) = 10 ms WTB = (3 – 3) + (15 – 6) = 9 ms WTC = (9 – 4) + (20 – 12) = 13 ms WTD = 12 – 6 = 6 ms WTE = 18 – 10 = 8 ms The average waiting time is (10 + 9 + 13 + 6 + 8)/5 = 46/5 = 9.2 ms   ___________________________________  ___________________________________  ___________________________________  ___________________________________  ___________________________________  ___________________________________  ___________________________________  Slide 17  *Property of STI J0024 Round Robin Algorithm (RR) TAA = 18 ‐ 6= 18 ms TAB = 16 ‐ 3 = 13 ms TAC = 22 ‐ 4 = 18 ms TAD = 15 ‐ 6 = 9 ms TAE = 20 ‐ 10 = 10 ms The average turnaround time is (18 + 13 + 18 + 9 + 10)/5 = 68/5 = 13.6 ms   ___________________________________  ___________________________________  ___________________________________  ___________________________________  ___________________________________  ___________________________________  ___________________________________  Slide 18  *Property of STI J0024 Priority Scheduling ‐ Each process is assigned a priority and the CPU scheduler selects the process in  the ready queue with the highest priority to execute next. Using the non‐preemptive priority algorithm: a.  b. Process ID Arrival Time CPU Burst Priority A 0 8 4 B 3 4 3 C 4 5 1 D 6 3 2 E 10 2 2 A 0 8 A 0 C 8 13   ___________________________________  ___________________________________  ___________________________________  ___________________________________  ___________________________________  ___________________________________  ___________________________________ 
  • 7. Slide 19  *Property of STI J0024 Priority Scheduling c.  d. e. WTA = 0 – 0 = 0 ms WTB = 18 – 3 = 15 ms WTC = 8 – 4 = 4 ms WTD = 13 – 6 = 7 ms WTE = 16 – 10 = 6 ms The average waiting time is (0 + 15 + 4 + 7 + 6)/5 = 32/5 = 6.4 ms A 0 C D 8 13 16 A 0 C D 8 13 16 18 E A 0 BC D 8 13 16 18 E 22   ___________________________________  ___________________________________  ___________________________________  ___________________________________  ___________________________________  ___________________________________  ___________________________________  Slide 20  *Property of STI J0024 Priority Scheduling TAA = 8 ‐ 0= 8 ms TAB = 22 – 3 = 19 ms TAC = 13 ‐ 4 = 9 ms TAD = 16 ‐ 6 = 10 ms TAE = 18 ‐ 10 = 8 ms The average turnaround time is (8 + 19 + 9 + 10 + 8)/5 = 54/5 = 10.8 ms   ___________________________________  ___________________________________  ___________________________________  ___________________________________  ___________________________________  ___________________________________  ___________________________________  Slide 21  *Property of STI J0024 Priority Scheduling Using the preemptive priority algorithm: a.  b. c.  d. Process ID Arrival Time CPU Burst Priority A 0 8 4 B 3 4 3 C 4 5 1 D 6 3 2 E 10 2 2 0 A 0 BA 3 0 B C 4 9 A 3 0 B C 4 9 A 3 D   ___________________________________  ___________________________________  ___________________________________  ___________________________________  ___________________________________  ___________________________________  ___________________________________ 
  • 8. Slide 22  *Property of STI J0024 Priority Scheduling e.  f. WTA = (0 – 0) + (17 – 3) = 14 ms WTB = (3 – 3) + (14 ‐ 4) = 10 ms WTC = (4 – 4) = 0 ms WTD = (9 – 6) = 3 ms WTE = (12 – 10) = 2 ms The average waiting time is (14 + 10 + 0 + 3 + 2)/5 = 29/5 = 5.8 ms 0 B C D 4 9 12 A 3 A 0 B C D 4 9 12 14 E 22 A 3 B 17   ___________________________________  ___________________________________  ___________________________________  ___________________________________  ___________________________________  ___________________________________  ___________________________________  Slide 23  *Property of STI J0024 Priority Scheduling TAA = 22 – 0 = 22 ms TAB = 17 ‐ 3 = 14 ms TAC = 9 ‐ 4 = 5 ms TAD = 12 ‐ 6 = 6 ms TAE = 14 ‐ 10 = 4 ms The average turnaround time is (22 + 14 + 5 + 6 + 4)/5 = 51/5 = 10.2 ms   ___________________________________  ___________________________________  ___________________________________  ___________________________________  ___________________________________  ___________________________________  ___________________________________  Slide 24  *Property of STI J0024 Multilevel Feedback Queues Q0All processes enter the queuing network at the rear of the highest priority queue Processes that finish executing or request for an I/O operation within the given time slice leave the queuing network FCFS (time slice = 10 ms) Q1 FCFS (time slice = 20 ms) Processes that do not finish executing within the given time slice move to the next lower-priority queue Processes that finish executing or request for an I/O operation within the given time slice leave the queuing network . . . Qn RR Processes that do not finish executing within the given time slice move to the next lower-priority queue Q2 FCFS (time slice = 30 ms) Processes that finish executing or request for an I/O operation within the given time slice leave the queuing network Processes that finish executing or request for an I/O operation within the given time slice leave the queuing network   ___________________________________  ___________________________________  ___________________________________  ___________________________________  ___________________________________  ___________________________________  ___________________________________