SlideShare a Scribd company logo
INTRODUCTION
o The CPU scheduling is used to improve its
efficiency.
o It is used to allocate resources among competing
processes.
o Maximum CPU utilization is obtained with
multiprogramming.
• The processes which are to be executed are in ready queue.
• Every time the running process is blocked , the process in the
ready queue takes over the CPU.
o A process may be
• I/O BOUND: Involves more I/O operation. Ex : reading from
disk.
• CPU BOUND: Involves more computation. Ex : calculating the
sum of 2 numbers from memory.
PROCESS STATES
o The 3 states of a process are ready , running and
wait states.
o CPU scheduling is affected by the following set
of circumstances:
• A process switches from running to waiting state.
• A process switches from running to ready state .
• A process switches from waiting to ready state .
• A processes switches from running to terminated state.
CPU SCHEDULING CRITERIA
o CPU Utilization: Percent of time that the CPU is
busy executing a process.
o Throughput: Number of processes executed per
unit time.
o Turnaround Time: The interval of time between
submission of a process and its completion.
o Waiting Time: The amount of time the process
spends in the ready queue waiting for the CPU.
o Response Time: The time between submission
of requests and first response to the request.
First Come First Served(FCFS)
o The process which enters the queue first is
executed first.
o It is non-preemptive.
Process Arrival Service TT NTT
P1 0 6 6 1
P2 2 4 8 2
P3 4 1 7 7
P1 P2 P3
0 6 10 11
FCFS
o Advantages:
It is simple and easy to understand.
o Disadvantages:
The process with less execution time suffer.
Favours CPU bound process then I/O bound
process.
Shortest Job First(SJF)
o The process with the lowest execution time is
executed first.
o It can be either preemptive or non preemptive.
Process Arrival Service TT NTT
P1 0 6 6 1
P2 2 4 9 2.2
P3 4 1 3 3
P1 P3 P2
0 6 7 11
SJF
o Advantages:
Shortest jobs are favoured.
o Disadvantages:
When there are more number of shorter jobs,
longer jobs starve.
Priority Scheduling(PS)
o Each process is associated with priority and the
CPU is allocated to each of them based on their
priorities.
o Multiple process with same priority are dealt
using FCFS.
Process Arrival Service TT NTT
P1 0 6 6 1
P2 2 4 8 2
P3 4 1 7 7
P1 P2 P3
0 6 10 11
PS
o Advantages:
Priority scheduling provides a good mechanism
where the relative importance of each process may be
precisely defined.
o Disadvantages:
• If high priority processes use up a lot of CPU
time, lower priority processes may starve and be
postponed indefinitely.
• The situation where a process never gets
scheduled to run is called starvation.
• Another problem with priority scheduling is
deciding which process gets which priority level
assigned to it.
Round Robin(RR)
o Each process is allotted a time slot(q). After this
time has elapsed, the process is pre-empted and
added to the end of the ready queue.
o Performance of the round robin algorithm
◦ q large  FCFS
◦ q small  q must be greater than the context
switch time; otherwise, the overhead is too high
RR
Process Arrival Service TT NTT
P1 0 6 12 2
P2 2 4 8 2
P3 4 2 2 1
q=2
o Advantages:
Round robin scheduling is fair in that every process
gets an equal share of the CPU.
P1
0 62
P2
4
P3 P1
8
P2
10
P1
12
RR
o Disadvantages:
Setting the quantum too short, increases the overhead
and lowers the CPU efficiency, but setting it too long
may cause poor response to short processes.
ANALYSIS AND RESULTS
o Comparing the average turnaround time and
waiting time, the algorithms are ranked as
SJF,FCFS and PS.
o Based on average CPU utilization the algorithms
are ranked as FC,PS and SJF.
o In terms of execution speed, FCFS was found to
be consistently faster than PS and SJF.
Thus according to the performance
measure the corresponding scheduling algorithm
is recommended to the CPU.

More Related Content

What's hot

Os prj ppt
Os prj pptOs prj ppt
Os prj ppt
Charmi Chokshi
 
First Come First Serve
First Come First ServeFirst Come First Serve
First Come First Serve
Edwin Makeu
 
SCHEDULING ALGORITHMS
SCHEDULING ALGORITHMSSCHEDULING ALGORITHMS
SCHEDULING ALGORITHMS
Margrat C R
 
OS - CPU Scheduling
OS - CPU SchedulingOS - CPU Scheduling
OS - CPU Scheduling
vinay arora
 
SCHEDULING ALGORITHMS
SCHEDULING ALGORITHMSSCHEDULING ALGORITHMS
SCHEDULING ALGORITHMS
Dhaval Sakhiya
 
Process Scheduling
Process SchedulingProcess Scheduling
Process Scheduling
Abhishek Nagar
 
Process scheduling algorithms
Process scheduling algorithmsProcess scheduling algorithms
Process scheduling algorithms
Shubham Sharma
 
05 lcd slides 1 - CPU SCHEDULING (Powerpoint)
05 lcd slides 1 - CPU SCHEDULING (Powerpoint)05 lcd slides 1 - CPU SCHEDULING (Powerpoint)
05 lcd slides 1 - CPU SCHEDULING (Powerpoint)
Anne Lee
 
OPERATING SYSTEM-"Scheduling policies"
OPERATING SYSTEM-"Scheduling policies"OPERATING SYSTEM-"Scheduling policies"
OPERATING SYSTEM-"Scheduling policies"
Ankit Surti
 
Presentation by adeel
Presentation by adeelPresentation by adeel
Presentation by adeel
Goodthingbetter
 
Smarter Scheduling (Priorities, Preemptive Priority Scheduling, Lottery and S...
Smarter Scheduling (Priorities, Preemptive Priority Scheduling, Lottery and S...Smarter Scheduling (Priorities, Preemptive Priority Scheduling, Lottery and S...
Smarter Scheduling (Priorities, Preemptive Priority Scheduling, Lottery and S...
David Evans
 
Cpu scheduling(suresh)
Cpu scheduling(suresh)Cpu scheduling(suresh)
Cpu scheduling(suresh)
Nagarajan
 
Cpu scheduling
Cpu schedulingCpu scheduling
Cpu scheduling
Arafat Hossan
 
Round-ribon algorithm presntation
Round-ribon algorithm presntationRound-ribon algorithm presntation
Round-ribon algorithm presntation
Jamsheed Ali
 
Cp usched 2
Cp usched  2Cp usched  2
Cp usched 2
nidsrajdev
 
Process scheduling in Light weight weight and Heavy weight processes.
Process scheduling in Light weight weight and Heavy weight processes.Process scheduling in Light weight weight and Heavy weight processes.
Process scheduling in Light weight weight and Heavy weight processes.
Shreya Kumar
 
Introduction to Scheduling
Introduction to SchedulingIntroduction to Scheduling
Introduction to Scheduling
pec2013
 
Comparision of different Round Robin Scheduling Algorithm using Dynamic Time ...
Comparision of different Round Robin Scheduling Algorithm using Dynamic Time ...Comparision of different Round Robin Scheduling Algorithm using Dynamic Time ...
Comparision of different Round Robin Scheduling Algorithm using Dynamic Time ...
Editor IJMTER
 
Cpu scheduling algorithm on windows
Cpu scheduling algorithm on windowsCpu scheduling algorithm on windows
Cpu scheduling algorithm on windows
siddhartha pande
 

What's hot (19)

Os prj ppt
Os prj pptOs prj ppt
Os prj ppt
 
First Come First Serve
First Come First ServeFirst Come First Serve
First Come First Serve
 
SCHEDULING ALGORITHMS
SCHEDULING ALGORITHMSSCHEDULING ALGORITHMS
SCHEDULING ALGORITHMS
 
OS - CPU Scheduling
OS - CPU SchedulingOS - CPU Scheduling
OS - CPU Scheduling
 
SCHEDULING ALGORITHMS
SCHEDULING ALGORITHMSSCHEDULING ALGORITHMS
SCHEDULING ALGORITHMS
 
Process Scheduling
Process SchedulingProcess Scheduling
Process Scheduling
 
Process scheduling algorithms
Process scheduling algorithmsProcess scheduling algorithms
Process scheduling algorithms
 
05 lcd slides 1 - CPU SCHEDULING (Powerpoint)
05 lcd slides 1 - CPU SCHEDULING (Powerpoint)05 lcd slides 1 - CPU SCHEDULING (Powerpoint)
05 lcd slides 1 - CPU SCHEDULING (Powerpoint)
 
OPERATING SYSTEM-"Scheduling policies"
OPERATING SYSTEM-"Scheduling policies"OPERATING SYSTEM-"Scheduling policies"
OPERATING SYSTEM-"Scheduling policies"
 
Presentation by adeel
Presentation by adeelPresentation by adeel
Presentation by adeel
 
Smarter Scheduling (Priorities, Preemptive Priority Scheduling, Lottery and S...
Smarter Scheduling (Priorities, Preemptive Priority Scheduling, Lottery and S...Smarter Scheduling (Priorities, Preemptive Priority Scheduling, Lottery and S...
Smarter Scheduling (Priorities, Preemptive Priority Scheduling, Lottery and S...
 
Cpu scheduling(suresh)
Cpu scheduling(suresh)Cpu scheduling(suresh)
Cpu scheduling(suresh)
 
Cpu scheduling
Cpu schedulingCpu scheduling
Cpu scheduling
 
Round-ribon algorithm presntation
Round-ribon algorithm presntationRound-ribon algorithm presntation
Round-ribon algorithm presntation
 
Cp usched 2
Cp usched  2Cp usched  2
Cp usched 2
 
Process scheduling in Light weight weight and Heavy weight processes.
Process scheduling in Light weight weight and Heavy weight processes.Process scheduling in Light weight weight and Heavy weight processes.
Process scheduling in Light weight weight and Heavy weight processes.
 
Introduction to Scheduling
Introduction to SchedulingIntroduction to Scheduling
Introduction to Scheduling
 
Comparision of different Round Robin Scheduling Algorithm using Dynamic Time ...
Comparision of different Round Robin Scheduling Algorithm using Dynamic Time ...Comparision of different Round Robin Scheduling Algorithm using Dynamic Time ...
Comparision of different Round Robin Scheduling Algorithm using Dynamic Time ...
 
Cpu scheduling algorithm on windows
Cpu scheduling algorithm on windowsCpu scheduling algorithm on windows
Cpu scheduling algorithm on windows
 

Similar to Cpu Schedule Algorithm

Operating system
Operating systemOperating system
Operating system
devanshi_chowdhary
 
Cpu scheduling
Cpu schedulingCpu scheduling
Cpu scheduling
mohsinalilarik1
 
CPU Scheduling
CPU SchedulingCPU Scheduling
CPU Scheduling
M. Abdullah Wasif
 
Scheduling algorithms
Scheduling algorithmsScheduling algorithms
Scheduling algorithms
Paurav Shah
 
Scheduling algo(by HJ)
Scheduling algo(by HJ)Scheduling algo(by HJ)
Scheduling algo(by HJ)
Harshit Jain
 
Scheduling
SchedulingScheduling
OS Process Chapter 3.pdf
OS Process Chapter 3.pdfOS Process Chapter 3.pdf
OS Process Chapter 3.pdf
Kp Sharma
 
Scheduling
SchedulingScheduling
Scheduling
Mohd Arif
 
chapter 5 CPU scheduling.ppt
chapter  5 CPU scheduling.pptchapter  5 CPU scheduling.ppt
chapter 5 CPU scheduling.ppt
KeyreSebre
 
CPU Scheduling.pdf
CPU Scheduling.pdfCPU Scheduling.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
Yogesh Santhan
 
CPU Scheduling
CPU SchedulingCPU Scheduling
CPU Scheduling
sammerkhan1
 
operating system (1).pdf
operating system (1).pdfoperating system (1).pdf
operating system (1).pdf
AliyanAbbas1
 
UNIPROCESS SCHEDULING.pptx
UNIPROCESS SCHEDULING.pptxUNIPROCESS SCHEDULING.pptx
UNIPROCESS SCHEDULING.pptx
ansariparveen06
 
CPU SCHEDULING IN OPERATING SYSTEMS IN DETAILED
CPU SCHEDULING IN OPERATING SYSTEMS IN DETAILEDCPU SCHEDULING IN OPERATING SYSTEMS IN DETAILED
CPU SCHEDULING IN OPERATING SYSTEMS IN DETAILED
VADAPALLYPRAVEENKUMA1
 
Scheduling Algorithms-Examples.pptx
Scheduling Algorithms-Examples.pptxScheduling Algorithms-Examples.pptx
Scheduling Algorithms-Examples.pptx
Revathi Kmp
 
Cpu Scheduling Galvin
Cpu Scheduling GalvinCpu Scheduling Galvin
Cpu Scheduling Galvin
Sonali Chauhan
 
Scheduling algorithm (chammu)
Scheduling algorithm (chammu)Scheduling algorithm (chammu)
Scheduling algorithm (chammu)
Nagarajan
 
Operating System-Process Scheduling
Operating System-Process SchedulingOperating System-Process Scheduling
Operating System-Process Scheduling
Shipra Swati
 
CPU scheduling
CPU schedulingCPU scheduling
CPU scheduling
Amir Khan
 

Similar to Cpu Schedule Algorithm (20)

Operating system
Operating systemOperating system
Operating system
 
Cpu scheduling
Cpu schedulingCpu scheduling
Cpu scheduling
 
CPU Scheduling
CPU SchedulingCPU Scheduling
CPU Scheduling
 
Scheduling algorithms
Scheduling algorithmsScheduling algorithms
Scheduling algorithms
 
Scheduling algo(by HJ)
Scheduling algo(by HJ)Scheduling algo(by HJ)
Scheduling algo(by HJ)
 
Scheduling
SchedulingScheduling
Scheduling
 
OS Process Chapter 3.pdf
OS Process Chapter 3.pdfOS Process Chapter 3.pdf
OS Process Chapter 3.pdf
 
Scheduling
SchedulingScheduling
Scheduling
 
chapter 5 CPU scheduling.ppt
chapter  5 CPU scheduling.pptchapter  5 CPU scheduling.ppt
chapter 5 CPU scheduling.ppt
 
CPU Scheduling.pdf
CPU Scheduling.pdfCPU Scheduling.pdf
CPU Scheduling.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
 
CPU Scheduling
CPU SchedulingCPU Scheduling
CPU Scheduling
 
operating system (1).pdf
operating system (1).pdfoperating system (1).pdf
operating system (1).pdf
 
UNIPROCESS SCHEDULING.pptx
UNIPROCESS SCHEDULING.pptxUNIPROCESS SCHEDULING.pptx
UNIPROCESS SCHEDULING.pptx
 
CPU SCHEDULING IN OPERATING SYSTEMS IN DETAILED
CPU SCHEDULING IN OPERATING SYSTEMS IN DETAILEDCPU SCHEDULING IN OPERATING SYSTEMS IN DETAILED
CPU SCHEDULING IN OPERATING SYSTEMS IN DETAILED
 
Scheduling Algorithms-Examples.pptx
Scheduling Algorithms-Examples.pptxScheduling Algorithms-Examples.pptx
Scheduling Algorithms-Examples.pptx
 
Cpu Scheduling Galvin
Cpu Scheduling GalvinCpu Scheduling Galvin
Cpu Scheduling Galvin
 
Scheduling algorithm (chammu)
Scheduling algorithm (chammu)Scheduling algorithm (chammu)
Scheduling algorithm (chammu)
 
Operating System-Process Scheduling
Operating System-Process SchedulingOperating System-Process Scheduling
Operating System-Process Scheduling
 
CPU scheduling
CPU schedulingCPU scheduling
CPU scheduling
 

Recently uploaded

Gabrielle M. A. Sinaga Portfolio, Film Student (2024)
Gabrielle M. A. Sinaga Portfolio, Film Student (2024)Gabrielle M. A. Sinaga Portfolio, Film Student (2024)
Gabrielle M. A. Sinaga Portfolio, Film Student (2024)
GabrielleSinaga
 
thyroid case presentation.pptx Kamala's Lakshaman palatial
thyroid case presentation.pptx Kamala's Lakshaman palatialthyroid case presentation.pptx Kamala's Lakshaman palatial
thyroid case presentation.pptx Kamala's Lakshaman palatial
Aditya Raghav
 
Leave-rules.ppt CCS leave rules 1972 for central govt employees
Leave-rules.ppt CCS leave rules 1972 for central govt employeesLeave-rules.ppt CCS leave rules 1972 for central govt employees
Leave-rules.ppt CCS leave rules 1972 for central govt employees
Sreenivas702647
 
Tape Measure Training & Practice Assessments.pdf
Tape Measure Training & Practice Assessments.pdfTape Measure Training & Practice Assessments.pdf
Tape Measure Training & Practice Assessments.pdf
KateRobinson68
 
IT Career Hacks Navigate the Tech Jungle with a Roadmap
IT Career Hacks Navigate the Tech Jungle with a RoadmapIT Career Hacks Navigate the Tech Jungle with a Roadmap
IT Career Hacks Navigate the Tech Jungle with a Roadmap
Base Camp
 
Switching Careers Slides - JoyceMSullivan SocMediaFin - 2024Jun11.pdf
Switching Careers Slides - JoyceMSullivan SocMediaFin -  2024Jun11.pdfSwitching Careers Slides - JoyceMSullivan SocMediaFin -  2024Jun11.pdf
Switching Careers Slides - JoyceMSullivan SocMediaFin - 2024Jun11.pdf
SocMediaFin - Joyce Sullivan
 
How to Prepare for Fortinet FCP_FAC_AD-6.5 Certification?
How to Prepare for Fortinet FCP_FAC_AD-6.5 Certification?How to Prepare for Fortinet FCP_FAC_AD-6.5 Certification?
How to Prepare for Fortinet FCP_FAC_AD-6.5 Certification?
NWEXAM
 
A Guide to a Winning Interview June 2024
A Guide to a Winning Interview June 2024A Guide to a Winning Interview June 2024
A Guide to a Winning Interview June 2024
Bruce Bennett
 
Lbs last rank 2023 9988kr47h4744j445.pdf
Lbs last rank 2023 9988kr47h4744j445.pdfLbs last rank 2023 9988kr47h4744j445.pdf
Lbs last rank 2023 9988kr47h4744j445.pdf
ashiquepa3
 
官方认证美国旧金山州立大学毕业证学位证书案例原版一模一样
官方认证美国旧金山州立大学毕业证学位证书案例原版一模一样官方认证美国旧金山州立大学毕业证学位证书案例原版一模一样
官方认证美国旧金山州立大学毕业证学位证书案例原版一模一样
2zjra9bn
 
一比一原版布拉德福德大学毕业证(bradford毕业证)如何办理
一比一原版布拉德福德大学毕业证(bradford毕业证)如何办理一比一原版布拉德福德大学毕业证(bradford毕业证)如何办理
一比一原版布拉德福德大学毕业证(bradford毕业证)如何办理
taqyea
 
Introducing Gopay Mobile App For Environment.pptx
Introducing Gopay Mobile App For Environment.pptxIntroducing Gopay Mobile App For Environment.pptx
Introducing Gopay Mobile App For Environment.pptx
FauzanHarits1
 
BUKU PENJAGAAN BUKU PENJAGAAN BUKU PENJAGAAN
BUKU PENJAGAAN BUKU PENJAGAAN BUKU PENJAGAANBUKU PENJAGAAN BUKU PENJAGAAN BUKU PENJAGAAN
BUKU PENJAGAAN BUKU PENJAGAAN BUKU PENJAGAAN
cahgading001
 
Status of Women in Pakistan.pptxStatus of Women in Pakistan.pptx
Status of Women in Pakistan.pptxStatus of Women in Pakistan.pptxStatus of Women in Pakistan.pptxStatus of Women in Pakistan.pptx
Status of Women in Pakistan.pptxStatus of Women in Pakistan.pptx
MuhammadWaqasBaloch1
 
Leadership Ambassador club Adventist module
Leadership Ambassador club Adventist moduleLeadership Ambassador club Adventist module
Leadership Ambassador club Adventist module
kakomaeric00
 
5 Common Mistakes to Avoid During the Job Application Process.pdf
5 Common Mistakes to Avoid During the Job Application Process.pdf5 Common Mistakes to Avoid During the Job Application Process.pdf
5 Common Mistakes to Avoid During the Job Application Process.pdf
Alliance Jobs
 
Resumes, Cover Letters, and Applying Online
Resumes, Cover Letters, and Applying OnlineResumes, Cover Letters, and Applying Online
Resumes, Cover Letters, and Applying Online
Bruce Bennett
 
0624.speakingengagementsandteaching-01.pdf
0624.speakingengagementsandteaching-01.pdf0624.speakingengagementsandteaching-01.pdf
0624.speakingengagementsandteaching-01.pdf
Thomas GIRARD BDes
 
Job Finding Apps Everything You Need to Know in 2024
Job Finding Apps Everything You Need to Know in 2024Job Finding Apps Everything You Need to Know in 2024
Job Finding Apps Everything You Need to Know in 2024
SnapJob
 
lab.123456789123456789123456789123456789
lab.123456789123456789123456789123456789lab.123456789123456789123456789123456789
lab.123456789123456789123456789123456789
Ghh
 

Recently uploaded (20)

Gabrielle M. A. Sinaga Portfolio, Film Student (2024)
Gabrielle M. A. Sinaga Portfolio, Film Student (2024)Gabrielle M. A. Sinaga Portfolio, Film Student (2024)
Gabrielle M. A. Sinaga Portfolio, Film Student (2024)
 
thyroid case presentation.pptx Kamala's Lakshaman palatial
thyroid case presentation.pptx Kamala's Lakshaman palatialthyroid case presentation.pptx Kamala's Lakshaman palatial
thyroid case presentation.pptx Kamala's Lakshaman palatial
 
Leave-rules.ppt CCS leave rules 1972 for central govt employees
Leave-rules.ppt CCS leave rules 1972 for central govt employeesLeave-rules.ppt CCS leave rules 1972 for central govt employees
Leave-rules.ppt CCS leave rules 1972 for central govt employees
 
Tape Measure Training & Practice Assessments.pdf
Tape Measure Training & Practice Assessments.pdfTape Measure Training & Practice Assessments.pdf
Tape Measure Training & Practice Assessments.pdf
 
IT Career Hacks Navigate the Tech Jungle with a Roadmap
IT Career Hacks Navigate the Tech Jungle with a RoadmapIT Career Hacks Navigate the Tech Jungle with a Roadmap
IT Career Hacks Navigate the Tech Jungle with a Roadmap
 
Switching Careers Slides - JoyceMSullivan SocMediaFin - 2024Jun11.pdf
Switching Careers Slides - JoyceMSullivan SocMediaFin -  2024Jun11.pdfSwitching Careers Slides - JoyceMSullivan SocMediaFin -  2024Jun11.pdf
Switching Careers Slides - JoyceMSullivan SocMediaFin - 2024Jun11.pdf
 
How to Prepare for Fortinet FCP_FAC_AD-6.5 Certification?
How to Prepare for Fortinet FCP_FAC_AD-6.5 Certification?How to Prepare for Fortinet FCP_FAC_AD-6.5 Certification?
How to Prepare for Fortinet FCP_FAC_AD-6.5 Certification?
 
A Guide to a Winning Interview June 2024
A Guide to a Winning Interview June 2024A Guide to a Winning Interview June 2024
A Guide to a Winning Interview June 2024
 
Lbs last rank 2023 9988kr47h4744j445.pdf
Lbs last rank 2023 9988kr47h4744j445.pdfLbs last rank 2023 9988kr47h4744j445.pdf
Lbs last rank 2023 9988kr47h4744j445.pdf
 
官方认证美国旧金山州立大学毕业证学位证书案例原版一模一样
官方认证美国旧金山州立大学毕业证学位证书案例原版一模一样官方认证美国旧金山州立大学毕业证学位证书案例原版一模一样
官方认证美国旧金山州立大学毕业证学位证书案例原版一模一样
 
一比一原版布拉德福德大学毕业证(bradford毕业证)如何办理
一比一原版布拉德福德大学毕业证(bradford毕业证)如何办理一比一原版布拉德福德大学毕业证(bradford毕业证)如何办理
一比一原版布拉德福德大学毕业证(bradford毕业证)如何办理
 
Introducing Gopay Mobile App For Environment.pptx
Introducing Gopay Mobile App For Environment.pptxIntroducing Gopay Mobile App For Environment.pptx
Introducing Gopay Mobile App For Environment.pptx
 
BUKU PENJAGAAN BUKU PENJAGAAN BUKU PENJAGAAN
BUKU PENJAGAAN BUKU PENJAGAAN BUKU PENJAGAANBUKU PENJAGAAN BUKU PENJAGAAN BUKU PENJAGAAN
BUKU PENJAGAAN BUKU PENJAGAAN BUKU PENJAGAAN
 
Status of Women in Pakistan.pptxStatus of Women in Pakistan.pptx
Status of Women in Pakistan.pptxStatus of Women in Pakistan.pptxStatus of Women in Pakistan.pptxStatus of Women in Pakistan.pptx
Status of Women in Pakistan.pptxStatus of Women in Pakistan.pptx
 
Leadership Ambassador club Adventist module
Leadership Ambassador club Adventist moduleLeadership Ambassador club Adventist module
Leadership Ambassador club Adventist module
 
5 Common Mistakes to Avoid During the Job Application Process.pdf
5 Common Mistakes to Avoid During the Job Application Process.pdf5 Common Mistakes to Avoid During the Job Application Process.pdf
5 Common Mistakes to Avoid During the Job Application Process.pdf
 
Resumes, Cover Letters, and Applying Online
Resumes, Cover Letters, and Applying OnlineResumes, Cover Letters, and Applying Online
Resumes, Cover Letters, and Applying Online
 
0624.speakingengagementsandteaching-01.pdf
0624.speakingengagementsandteaching-01.pdf0624.speakingengagementsandteaching-01.pdf
0624.speakingengagementsandteaching-01.pdf
 
Job Finding Apps Everything You Need to Know in 2024
Job Finding Apps Everything You Need to Know in 2024Job Finding Apps Everything You Need to Know in 2024
Job Finding Apps Everything You Need to Know in 2024
 
lab.123456789123456789123456789123456789
lab.123456789123456789123456789123456789lab.123456789123456789123456789123456789
lab.123456789123456789123456789123456789
 

Cpu Schedule Algorithm

  • 1.
  • 2. INTRODUCTION o The CPU scheduling is used to improve its efficiency. o It is used to allocate resources among competing processes. o Maximum CPU utilization is obtained with multiprogramming. • The processes which are to be executed are in ready queue. • Every time the running process is blocked , the process in the ready queue takes over the CPU. o A process may be • I/O BOUND: Involves more I/O operation. Ex : reading from disk. • CPU BOUND: Involves more computation. Ex : calculating the sum of 2 numbers from memory.
  • 3. PROCESS STATES o The 3 states of a process are ready , running and wait states. o CPU scheduling is affected by the following set of circumstances: • A process switches from running to waiting state. • A process switches from running to ready state . • A process switches from waiting to ready state . • A processes switches from running to terminated state.
  • 4. CPU SCHEDULING CRITERIA o CPU Utilization: Percent of time that the CPU is busy executing a process. o Throughput: Number of processes executed per unit time. o Turnaround Time: The interval of time between submission of a process and its completion. o Waiting Time: The amount of time the process spends in the ready queue waiting for the CPU. o Response Time: The time between submission of requests and first response to the request.
  • 5. First Come First Served(FCFS) o The process which enters the queue first is executed first. o It is non-preemptive. Process Arrival Service TT NTT P1 0 6 6 1 P2 2 4 8 2 P3 4 1 7 7 P1 P2 P3 0 6 10 11
  • 6. FCFS o Advantages: It is simple and easy to understand. o Disadvantages: The process with less execution time suffer. Favours CPU bound process then I/O bound process.
  • 7. Shortest Job First(SJF) o The process with the lowest execution time is executed first. o It can be either preemptive or non preemptive. Process Arrival Service TT NTT P1 0 6 6 1 P2 2 4 9 2.2 P3 4 1 3 3 P1 P3 P2 0 6 7 11
  • 8. SJF o Advantages: Shortest jobs are favoured. o Disadvantages: When there are more number of shorter jobs, longer jobs starve.
  • 9. Priority Scheduling(PS) o Each process is associated with priority and the CPU is allocated to each of them based on their priorities. o Multiple process with same priority are dealt using FCFS. Process Arrival Service TT NTT P1 0 6 6 1 P2 2 4 8 2 P3 4 1 7 7 P1 P2 P3 0 6 10 11
  • 10. PS o Advantages: Priority scheduling provides a good mechanism where the relative importance of each process may be precisely defined. o Disadvantages: • If high priority processes use up a lot of CPU time, lower priority processes may starve and be postponed indefinitely. • The situation where a process never gets scheduled to run is called starvation. • Another problem with priority scheduling is deciding which process gets which priority level assigned to it.
  • 11. Round Robin(RR) o Each process is allotted a time slot(q). After this time has elapsed, the process is pre-empted and added to the end of the ready queue. o Performance of the round robin algorithm ◦ q large  FCFS ◦ q small  q must be greater than the context switch time; otherwise, the overhead is too high
  • 12. RR Process Arrival Service TT NTT P1 0 6 12 2 P2 2 4 8 2 P3 4 2 2 1 q=2 o Advantages: Round robin scheduling is fair in that every process gets an equal share of the CPU. P1 0 62 P2 4 P3 P1 8 P2 10 P1 12
  • 13. RR o Disadvantages: Setting the quantum too short, increases the overhead and lowers the CPU efficiency, but setting it too long may cause poor response to short processes.
  • 14. ANALYSIS AND RESULTS o Comparing the average turnaround time and waiting time, the algorithms are ranked as SJF,FCFS and PS. o Based on average CPU utilization the algorithms are ranked as FC,PS and SJF. o In terms of execution speed, FCFS was found to be consistently faster than PS and SJF. Thus according to the performance measure the corresponding scheduling algorithm is recommended to the CPU.