SlideShare a Scribd company logo
1 of 24
CPU Scheduling
 Classification of CPU Scheduling
 Performance Criteria of Good Scheduler
 CPU Scheduling Algorithms
*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.
*Property of STI J0024
A good scheduler should optimize the following performance criteria:
 CPU utilization
 Throughput
 Turnaround time
 Response time
 Waiting time
*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
*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
*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
*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
*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
*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
*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
*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
*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
*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
*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
*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
*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
*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
*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
*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
*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
*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
*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
*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
*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

Physical and Logical Clocks
Physical and Logical ClocksPhysical and Logical Clocks
Physical and Logical ClocksDilum Bandara
 
Recovery system
Recovery systemRecovery system
Recovery systemRakesh S
 
Algorithmic problem solving
Algorithmic problem solvingAlgorithmic problem solving
Algorithmic problem solvingPrabhakaran V M
 
Synchronous vs Asynchronous Programming
Synchronous vs Asynchronous ProgrammingSynchronous vs Asynchronous Programming
Synchronous vs Asynchronous Programmingjeetendra mandal
 
4.3 techniques for turing machines construction
4.3 techniques for turing machines construction4.3 techniques for turing machines construction
4.3 techniques for turing machines constructionSampath Kumar S
 
Bellman Ford Routing Algorithm-Computer Networks
Bellman Ford Routing Algorithm-Computer NetworksBellman Ford Routing Algorithm-Computer Networks
Bellman Ford Routing Algorithm-Computer NetworksSimranJain63
 
Window scheduling algorithm
Window scheduling algorithmWindow scheduling algorithm
Window scheduling algorithmBinal Parekh
 
Web essentials clients, servers and communication – the internet – basic inte...
Web essentials clients, servers and communication – the internet – basic inte...Web essentials clients, servers and communication – the internet – basic inte...
Web essentials clients, servers and communication – the internet – basic inte...smitha273566
 
introduction to operating system
introduction to operating systemintroduction to operating system
introduction to operating systemHAMZA AHMED
 
DESIGN AND ANALYSIS OF ALGORITHMS
DESIGN AND ANALYSIS OF ALGORITHMSDESIGN AND ANALYSIS OF ALGORITHMS
DESIGN AND ANALYSIS OF ALGORITHMSGayathri Gaayu
 
Cloud Computing Architecture: Components, Importance, and Tips
Cloud Computing Architecture: Components, Importance, and TipsCloud Computing Architecture: Components, Importance, and Tips
Cloud Computing Architecture: Components, Importance, and TipsFibonalabs
 
8 queens problem using back tracking
8 queens problem using back tracking8 queens problem using back tracking
8 queens problem using back trackingTech_MX
 
IoT on Raspberry PI v1.2
IoT on Raspberry PI v1.2IoT on Raspberry PI v1.2
IoT on Raspberry PI v1.2John Staveley
 
Mobile computing : Indirect TCP
Mobile computing : Indirect TCPMobile computing : Indirect TCP
Mobile computing : Indirect TCPSushant Kushwaha
 

What's hot (20)

Physical and Logical Clocks
Physical and Logical ClocksPhysical and Logical Clocks
Physical and Logical Clocks
 
Dss6 7
Dss6 7Dss6 7
Dss6 7
 
Automata theory -RE to NFA-ε
Automata theory -RE to  NFA-εAutomata theory -RE to  NFA-ε
Automata theory -RE to NFA-ε
 
Distributed Operating System_1
Distributed Operating System_1Distributed Operating System_1
Distributed Operating System_1
 
Recovery system
Recovery systemRecovery system
Recovery system
 
Floyd Warshall Algorithm
Floyd Warshall AlgorithmFloyd Warshall Algorithm
Floyd Warshall Algorithm
 
Algorithmic problem solving
Algorithmic problem solvingAlgorithmic problem solving
Algorithmic problem solving
 
Optimal binary search tree dynamic programming
Optimal binary search tree   dynamic programmingOptimal binary search tree   dynamic programming
Optimal binary search tree dynamic programming
 
Synchronous vs Asynchronous Programming
Synchronous vs Asynchronous ProgrammingSynchronous vs Asynchronous Programming
Synchronous vs Asynchronous Programming
 
4.3 techniques for turing machines construction
4.3 techniques for turing machines construction4.3 techniques for turing machines construction
4.3 techniques for turing machines construction
 
Bellman Ford Routing Algorithm-Computer Networks
Bellman Ford Routing Algorithm-Computer NetworksBellman Ford Routing Algorithm-Computer Networks
Bellman Ford Routing Algorithm-Computer Networks
 
Window scheduling algorithm
Window scheduling algorithmWindow scheduling algorithm
Window scheduling algorithm
 
Web essentials clients, servers and communication – the internet – basic inte...
Web essentials clients, servers and communication – the internet – basic inte...Web essentials clients, servers and communication – the internet – basic inte...
Web essentials clients, servers and communication – the internet – basic inte...
 
introduction to operating system
introduction to operating systemintroduction to operating system
introduction to operating system
 
DESIGN AND ANALYSIS OF ALGORITHMS
DESIGN AND ANALYSIS OF ALGORITHMSDESIGN AND ANALYSIS OF ALGORITHMS
DESIGN AND ANALYSIS OF ALGORITHMS
 
Cs8493 unit 5
Cs8493 unit 5Cs8493 unit 5
Cs8493 unit 5
 
Cloud Computing Architecture: Components, Importance, and Tips
Cloud Computing Architecture: Components, Importance, and TipsCloud Computing Architecture: Components, Importance, and Tips
Cloud Computing Architecture: Components, Importance, and Tips
 
8 queens problem using back tracking
8 queens problem using back tracking8 queens problem using back tracking
8 queens problem using back tracking
 
IoT on Raspberry PI v1.2
IoT on Raspberry PI v1.2IoT on Raspberry PI v1.2
IoT on Raspberry PI v1.2
 
Mobile computing : Indirect TCP
Mobile computing : Indirect TCPMobile computing : Indirect TCP
Mobile computing : Indirect TCP
 

Viewers also liked

05 lcd slide handout 1 - CPU SCHEDULING
05 lcd slide handout 1 - CPU SCHEDULING05 lcd slide handout 1 - CPU SCHEDULING
05 lcd slide handout 1 - CPU SCHEDULINGAnne Lee
 
presentation on real time operating system(RTOS's)
presentation on real time operating system(RTOS's)presentation on real time operating system(RTOS's)
presentation on real time operating system(RTOS's)chetan mudenoor
 
Interfacing keypad
Interfacing keypadInterfacing keypad
Interfacing keypadPRADEEP
 
CPU Scheduling algorithms
CPU Scheduling algorithmsCPU Scheduling algorithms
CPU Scheduling algorithmsShanu Kumar
 
Introduction to System Calls
Introduction to System CallsIntroduction to System Calls
Introduction to System CallsVandana Salve
 
Scheduling and sequencing
Scheduling and sequencingScheduling and sequencing
Scheduling and sequencingAkanksha Gupta
 
Operating system.ppt (1)
Operating system.ppt (1)Operating system.ppt (1)
Operating system.ppt (1)Vaibhav Bajaj
 
CPU scheduling algorithms in OS
CPU scheduling algorithms in OSCPU scheduling algorithms in OS
CPU scheduling algorithms in OSharini0810
 

Viewers also liked (17)

CPU Scheduling Algorithms
CPU Scheduling AlgorithmsCPU Scheduling Algorithms
CPU Scheduling Algorithms
 
05 lcd slide handout 1 - CPU SCHEDULING
05 lcd slide handout 1 - CPU SCHEDULING05 lcd slide handout 1 - CPU SCHEDULING
05 lcd slide handout 1 - CPU SCHEDULING
 
Lcd 16x2
Lcd 16x2Lcd 16x2
Lcd 16x2
 
presentation on real time operating system(RTOS's)
presentation on real time operating system(RTOS's)presentation on real time operating system(RTOS's)
presentation on real time operating system(RTOS's)
 
Interfacing keypad
Interfacing keypadInterfacing keypad
Interfacing keypad
 
System call
System callSystem call
System call
 
Lcd
LcdLcd
Lcd
 
CPU Scheduling algorithms
CPU Scheduling algorithmsCPU Scheduling algorithms
CPU Scheduling algorithms
 
Scheduling algorithms
Scheduling algorithmsScheduling algorithms
Scheduling algorithms
 
Interfacing LCD with 8051 Microcontroller
Interfacing LCD with 8051 MicrocontrollerInterfacing LCD with 8051 Microcontroller
Interfacing LCD with 8051 Microcontroller
 
System calls
System callsSystem calls
System calls
 
Introduction to System Calls
Introduction to System CallsIntroduction to System Calls
Introduction to System Calls
 
Scheduling and sequencing
Scheduling and sequencingScheduling and sequencing
Scheduling and sequencing
 
Lcd interfacing
Lcd interfacingLcd interfacing
Lcd interfacing
 
Operating system.ppt (1)
Operating system.ppt (1)Operating system.ppt (1)
Operating system.ppt (1)
 
CPU scheduling algorithms in OS
CPU scheduling algorithms in OSCPU scheduling algorithms in OS
CPU scheduling algorithms in OS
 
Presentation on operating system
 Presentation on operating system Presentation on operating system
Presentation on operating system
 

Similar to 05 lcd slides 1 - CPU SCHEDULING (Powerpoint)

cpu schduling ppt.pdf
cpu schduling ppt.pdfcpu schduling ppt.pdf
cpu schduling ppt.pdfSangeethaBS4
 
AlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorit...
AlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorit...AlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorit...
AlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorit...Shanmuganathan C
 
C vs Java: Finding Prime Numbers
C vs Java: Finding Prime NumbersC vs Java: Finding Prime Numbers
C vs Java: Finding Prime NumbersAdam Feldscher
 
Priority Scheduling.pptx
Priority Scheduling.pptxPriority Scheduling.pptx
Priority Scheduling.pptxSarupyaDatta1
 
What is the waiting time of each process for each of the scheduling a.pdf
What is the waiting time of each process for each of the scheduling a.pdfWhat is the waiting time of each process for each of the scheduling a.pdf
What is the waiting time of each process for each of the scheduling a.pdfpearlcoburnsanche303
 
[嵌入式系統] MCS-51 實驗 - 使用 IAR (2)
[嵌入式系統] MCS-51 實驗 - 使用 IAR (2)[嵌入式系統] MCS-51 實驗 - 使用 IAR (2)
[嵌入式系統] MCS-51 實驗 - 使用 IAR (2)Simen Li
 
Scheduling Fixed Priority Tasks with Preemption Threshold
Scheduling Fixed Priority Tasks with Preemption ThresholdScheduling Fixed Priority Tasks with Preemption Threshold
Scheduling Fixed Priority Tasks with Preemption ThresholdDeepak Raj
 
Tracing Parallel Execution (UKOUG 2006)
Tracing Parallel Execution (UKOUG 2006)Tracing Parallel Execution (UKOUG 2006)
Tracing Parallel Execution (UKOUG 2006)Doug Burns
 
CPU scheduling
CPU schedulingCPU scheduling
CPU schedulingAmir Khan
 
Operations Research_18ME735_module 5 sequencing notes.pdf
Operations Research_18ME735_module 5 sequencing notes.pdfOperations Research_18ME735_module 5 sequencing notes.pdf
Operations Research_18ME735_module 5 sequencing notes.pdfRoopaDNDandally
 
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
 
8051 Timers and Counters
8051 Timers and Counters8051 Timers and Counters
8051 Timers and Counterscjbas
 

Similar to 05 lcd slides 1 - CPU SCHEDULING (Powerpoint) (20)

cpu schduling ppt.pdf
cpu schduling ppt.pdfcpu schduling ppt.pdf
cpu schduling ppt.pdf
 
Cpu scheduling
Cpu schedulingCpu scheduling
Cpu scheduling
 
AlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorit...
AlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorit...AlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorit...
AlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorit...
 
Os module 2 ba
Os module 2 baOs module 2 ba
Os module 2 ba
 
C vs Java: Finding Prime Numbers
C vs Java: Finding Prime NumbersC vs Java: Finding Prime Numbers
C vs Java: Finding Prime Numbers
 
CPU Scheduling
CPU SchedulingCPU Scheduling
CPU Scheduling
 
Priority Scheduling.pptx
Priority Scheduling.pptxPriority Scheduling.pptx
Priority Scheduling.pptx
 
CPU Scheduling.pdf
CPU Scheduling.pdfCPU Scheduling.pdf
CPU Scheduling.pdf
 
Shortest Job First
Shortest Job FirstShortest Job First
Shortest Job First
 
What is the waiting time of each process for each of the scheduling a.pdf
What is the waiting time of each process for each of the scheduling a.pdfWhat is the waiting time of each process for each of the scheduling a.pdf
What is the waiting time of each process for each of the scheduling a.pdf
 
[嵌入式系統] MCS-51 實驗 - 使用 IAR (2)
[嵌入式系統] MCS-51 實驗 - 使用 IAR (2)[嵌入式系統] MCS-51 實驗 - 使用 IAR (2)
[嵌入式系統] MCS-51 實驗 - 使用 IAR (2)
 
Scheduling Fixed Priority Tasks with Preemption Threshold
Scheduling Fixed Priority Tasks with Preemption ThresholdScheduling Fixed Priority Tasks with Preemption Threshold
Scheduling Fixed Priority Tasks with Preemption Threshold
 
Sa by shekhar
Sa by shekharSa by shekhar
Sa by shekhar
 
Ch5 answers
Ch5 answersCh5 answers
Ch5 answers
 
GCC
GCCGCC
GCC
 
Tracing Parallel Execution (UKOUG 2006)
Tracing Parallel Execution (UKOUG 2006)Tracing Parallel Execution (UKOUG 2006)
Tracing Parallel Execution (UKOUG 2006)
 
CPU scheduling
CPU schedulingCPU scheduling
CPU scheduling
 
Operations Research_18ME735_module 5 sequencing notes.pdf
Operations Research_18ME735_module 5 sequencing notes.pdfOperations Research_18ME735_module 5 sequencing notes.pdf
Operations Research_18ME735_module 5 sequencing notes.pdf
 
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
 
8051 Timers and Counters
8051 Timers and Counters8051 Timers and Counters
8051 Timers and Counters
 

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

Large Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLarge Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLionel Briand
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Angel Borroy López
 
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News UpdateVictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News UpdateVictoriaMetrics
 
2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shardsChristopher Curtin
 
Strategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero resultsStrategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero resultsJean Silva
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Cizo Technology Services
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf31events.com
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationBradBedford3
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringHironori Washizaki
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...OnePlan Solutions
 
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfExploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfkalichargn70th171
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfDrew Moseley
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsSafe Software
 
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
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfMarharyta Nedzelska
 
SoftTeco - Software Development Company Profile
SoftTeco - Software Development Company ProfileSoftTeco - Software Development Company Profile
SoftTeco - Software Development Company Profileakrivarotava
 
Patterns for automating API delivery. API conference
Patterns for automating API delivery. API conferencePatterns for automating API delivery. API conference
Patterns for automating API delivery. API conferencessuser9e7c64
 
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdfEnhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdfRTS corp
 
SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?Alexandre Beguel
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxAndreas Kunz
 

Recently uploaded (20)

Large Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLarge Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and Repair
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
 
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News UpdateVictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
 
2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards
 
Strategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero resultsStrategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero results
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion Application
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their Engineering
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
 
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfExploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdf
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data Streams
 
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
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdf
 
SoftTeco - Software Development Company Profile
SoftTeco - Software Development Company ProfileSoftTeco - Software Development Company Profile
SoftTeco - Software Development Company Profile
 
Patterns for automating API delivery. API conference
Patterns for automating API delivery. API conferencePatterns for automating API delivery. API conference
Patterns for automating API delivery. API conference
 
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdfEnhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
 
SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
 

05 lcd slides 1 - CPU SCHEDULING (Powerpoint)

  • 1. CPU Scheduling  Classification of CPU Scheduling  Performance Criteria of Good Scheduler  CPU Scheduling Algorithms
  • 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.
  • 3. *Property of STI J0024 A good scheduler should optimize the following performance criteria:  CPU utilization  Throughput  Turnaround time  Response time  Waiting time
  • 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
  • 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
  • 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
  • 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
  • 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
  • 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
  • 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
  • 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
  • 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
  • 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
  • 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
  • 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
  • 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
  • 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
  • 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
  • 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
  • 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
  • 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
  • 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
  • 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
  • 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