SlideShare a Scribd company logo
OPERATING SYSTEM
CPU Scheduling
Algorithm
SCHEDULING CRITERIA
There are many scheduling algorithms and various
criteria to judge their performance some criteria are
as follows:
o CPU Utilization: CPU should be busy (from 0 to
100%)
o Throughput: the number of process executed in a
specified time period
o Turnaround time: needed to execute a process
o Waiting Time: amount of time a process has
waited
o Response Time: between request and response
A CPU SCHEDULING ALGORITHM
MUST MAXIMIZE THE FOLLOWING
CPU utilization should maximum
Throughput should maximum
A CPU SCHEDULING ALGORITHM MUST
MINIMIZE THE FOLLOWING:
 Waiting Time should minimum
 Response Time should minimum
 Turnaround Time should minimum
SCHEDULING ALGORITHMS:
Below is the list of some well known
algorithms
First Come First Served (FCFS)
scheduling- non preemptive
Shortest job First(SJF) scheduling
preemptive non preemptive
Priority Scheduling preemptive non
preemptive
Round robin scheduling preemptive
TIMELINES:
Scheduling is based on the information
that is available at the give time. we
need some ways to represent the state
of the system and any process in it
and how it change over time.
Gantt chart are used for this purpose
to present them in graphical way.
GANTT CHART
1st Process 2nd Process More Processes
1st process end time 2nd Process end time…… End time.
Start time p1 end time p2end time……End time.
First come First Served (FCFS)
•Simplest
•Similar to queue
Operating system
Process Name Start Time Burst Time
Process 1 0 24
Process 2 0 3
Process3 0 3
Example 1
Process1 Process2 Process3
0 24 27 30
FCFS
 The following table shows the waiting time for each
process:
Average Waiting time is(0+24+27)/3=17
Process
name
Arrival
time
Burst time Finish time Waiting
time
Process1 0 24 24 0
Process2 0 3 27 24
Process3 0 3 30 27
Gantt chart
P1 P2 P3
0 3 6
30
Process Name Start Time Burst Time
Process 2 0 3
Process 3 0 3
Process1 0 24
Example 2
Process
name
Arrival time Burst time Finish time Waiting
time
Process2 0 3 3 0
Process3 0 3 6 3
Process1 0 24 30 6
Average Waiting time is (0+3+6)/3= 3
Shortest Job First:
Another way to scheduling jobs is
to pick the job that will take least
amount of time to complete, based
on burst size. In this way the
average waiting time reduced.
•Normal SJF
•Non preemptive
• Preemptive
Operating system
Operating system
Non preemptive SJF Example:
Process name Arrival time Burst time
Process1 0 7
Process2 2 4
Process3 4 2
Process4 5 4
Process name Arrival time Burst time Finish time Waiting time
Process1 0 7 7 0
Process2 2 4 13 7
Process3 4 2 9 3
Process4 5 4 17 8
Process name Arrival time Burst time
Process1 0 7
Process2 2 4
Process3 4 1
Process4 5 4
Preemptive SJF Example 2
Process name Arrival time Burst time Finish time Waiting time
Process1 0 7 16 9
Process2 2 4 7 1
Process3 4 1 5 0
Process4 5 4 11 2
Requires that each process should
have priority associated with it.
Priority scheduling:
Priority scheduling Example for Non Preemptive
Process name Burst Time Priority
Process1 10 3
Process2 1 1
Process3 2 3
Process4 1 4
Process5 5 2
Process2 Process5 Process1 Process3 Process4
Priority scheduling Example Preemptive
Process name Arrival time Burst time Priority
Process1 0 10 3
Process2 2 1 1
Process3 4 2 2
Process4 6 1 4
Process5 8 5 5
Gantt Chart
0 1 6 16 18 ` 19
P1 P2 P1 P3 P1 P2 P5
Round robin scheduling
Gantt Chart
0 2 3 4 6 13 14
19
Another way to schedule jobs is to assign a small amount of
time to each process in which it executes. This time the unite
is called time quantum or tie slice, the job is allocated to CPU
for the quantum. when the time quantum expires, the process
preempted from CPU and replaced by next process in the
circle queue.
Operating system
Process name Burst time
Process1 24
Process2 3
Process3 3
Gantt Chart
P1 P2 P3 P1 P1 P1 P1 P1
0 4 7 10 14 18 22 26 30
(10+7+30)/3=16
THANKS…..

More Related Content

PPT
CPU Scheduling Algorithms
PPT
Ch6
 
PPT
Sa by shekhar
PPTX
Cpu scheduling
PPT
Scheduling algorithms
PPT
Processor / CPU Scheduling
PPTX
Cpu scheduling
PPSX
CPU Scheduling algorithms
CPU Scheduling Algorithms
Ch6
 
Sa by shekhar
Cpu scheduling
Scheduling algorithms
Processor / CPU Scheduling
Cpu scheduling
CPU Scheduling algorithms

What's hot (20)

PPT
Priority scheduling algorithms
PPTX
CPU Scheduling in OS Presentation
PPTX
SCHEDULING ALGORITHMS
PDF
Comparison Analysis of CPU Scheduling : FCFS, SJF and Round Robin
PPT
PDF
PPTX
Round robin scheduling
PPT
9 cm402.19
PPT
17 cpu scheduling and scheduling criteria
PPTX
cpu scheduling
PDF
Operating System-Process Scheduling
PDF
RR and priority scheduling
PPT
first come first serve scheduling in os
PPT
Cp usched 2
PPT
First Come First Serve
DOCX
Cpu scheduling
PDF
5 Process Scheduling
PPTX
CPU scheduling algorithms in OS
PPTX
CPU Scheduling Algorithms
PPTX
SCHEDULING ALGORITHMS
Priority scheduling algorithms
CPU Scheduling in OS Presentation
SCHEDULING ALGORITHMS
Comparison Analysis of CPU Scheduling : FCFS, SJF and Round Robin
Round robin scheduling
9 cm402.19
17 cpu scheduling and scheduling criteria
cpu scheduling
Operating System-Process Scheduling
RR and priority scheduling
first come first serve scheduling in os
Cp usched 2
First Come First Serve
Cpu scheduling
5 Process Scheduling
CPU scheduling algorithms in OS
CPU Scheduling Algorithms
SCHEDULING ALGORITHMS
Ad

Similar to Operating system (20)

PPT
OS-operating systems- ch05 (CPU Scheduling) ...
PPTX
operating system scheduling concept lec2
PPTX
CPU Scheduling
PPTX
Week 5a.pptx of cpu scheduling operating system class
PPT
Ch05 cpu-scheduling
PPT
operating system Scheduling process unit 3.ppt
PPTX
Chapter 3 - Operating System Scheduling.pptx
PPTX
CPU Scheduling
PPTX
Cpu scheduling
PPT
Cpu Scheduling Galvin
DOC
Operating Systems Third Unit - Fourth Semester - Engineering
PPTX
CPU scheduling
PDF
Lec SRTF, Priority, RR scheduling OS.pdf
PPTX
Round-ribon algorithm presntation
PPT
Process Scheduling in Ope Spptystems rating
PPT
ch6- CPU scheduling https://www.slideshare.net/slideshow/operating-system-18-...
PPTX
3Chapter Three- CPU Scheduling this is the best.pptx
PPTX
Operating systems - Processes Scheduling
PDF
OS Process Chapter 3.pdf
OS-operating systems- ch05 (CPU Scheduling) ...
operating system scheduling concept lec2
CPU Scheduling
Week 5a.pptx of cpu scheduling operating system class
Ch05 cpu-scheduling
operating system Scheduling process unit 3.ppt
Chapter 3 - Operating System Scheduling.pptx
CPU Scheduling
Cpu scheduling
Cpu Scheduling Galvin
Operating Systems Third Unit - Fourth Semester - Engineering
CPU scheduling
Lec SRTF, Priority, RR scheduling OS.pdf
Round-ribon algorithm presntation
Process Scheduling in Ope Spptystems rating
ch6- CPU scheduling https://www.slideshare.net/slideshow/operating-system-18-...
3Chapter Three- CPU Scheduling this is the best.pptx
Operating systems - Processes Scheduling
OS Process Chapter 3.pdf
Ad

Recently uploaded (20)

PPTX
Cell Structure & Organelles in detailed.
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PDF
Pre independence Education in Inndia.pdf
PDF
Microbial disease of the cardiovascular and lymphatic systems
PPTX
Pharma ospi slides which help in ospi learning
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PPTX
Week 4 Term 3 Study Techniques revisited.pptx
PPTX
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
PDF
Insiders guide to clinical Medicine.pdf
PDF
Basic Mud Logging Guide for educational purpose
PDF
Anesthesia in Laparoscopic Surgery in India
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PPTX
Cell Types and Its function , kingdom of life
PDF
O7-L3 Supply Chain Operations - ICLT Program
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PDF
Classroom Observation Tools for Teachers
Cell Structure & Organelles in detailed.
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Pre independence Education in Inndia.pdf
Microbial disease of the cardiovascular and lymphatic systems
Pharma ospi slides which help in ospi learning
Supply Chain Operations Speaking Notes -ICLT Program
Module 4: Burden of Disease Tutorial Slides S2 2025
Week 4 Term 3 Study Techniques revisited.pptx
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
Insiders guide to clinical Medicine.pdf
Basic Mud Logging Guide for educational purpose
Anesthesia in Laparoscopic Surgery in India
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
Microbial diseases, their pathogenesis and prophylaxis
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
O5-L3 Freight Transport Ops (International) V1.pdf
Cell Types and Its function , kingdom of life
O7-L3 Supply Chain Operations - ICLT Program
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
Classroom Observation Tools for Teachers

Operating system

  • 2. SCHEDULING CRITERIA There are many scheduling algorithms and various criteria to judge their performance some criteria are as follows: o CPU Utilization: CPU should be busy (from 0 to 100%) o Throughput: the number of process executed in a specified time period o Turnaround time: needed to execute a process o Waiting Time: amount of time a process has waited o Response Time: between request and response
  • 3. A CPU SCHEDULING ALGORITHM MUST MAXIMIZE THE FOLLOWING CPU utilization should maximum Throughput should maximum
  • 4. A CPU SCHEDULING ALGORITHM MUST MINIMIZE THE FOLLOWING:  Waiting Time should minimum  Response Time should minimum  Turnaround Time should minimum
  • 5. SCHEDULING ALGORITHMS: Below is the list of some well known algorithms First Come First Served (FCFS) scheduling- non preemptive Shortest job First(SJF) scheduling preemptive non preemptive Priority Scheduling preemptive non preemptive Round robin scheduling preemptive
  • 6. TIMELINES: Scheduling is based on the information that is available at the give time. we need some ways to represent the state of the system and any process in it and how it change over time. Gantt chart are used for this purpose to present them in graphical way.
  • 7. GANTT CHART 1st Process 2nd Process More Processes 1st process end time 2nd Process end time…… End time. Start time p1 end time p2end time……End time. First come First Served (FCFS) •Simplest •Similar to queue
  • 9. Process Name Start Time Burst Time Process 1 0 24 Process 2 0 3 Process3 0 3 Example 1 Process1 Process2 Process3 0 24 27 30
  • 10. FCFS  The following table shows the waiting time for each process: Average Waiting time is(0+24+27)/3=17 Process name Arrival time Burst time Finish time Waiting time Process1 0 24 24 0 Process2 0 3 27 24 Process3 0 3 30 27
  • 11. Gantt chart P1 P2 P3 0 3 6 30 Process Name Start Time Burst Time Process 2 0 3 Process 3 0 3 Process1 0 24 Example 2
  • 12. Process name Arrival time Burst time Finish time Waiting time Process2 0 3 3 0 Process3 0 3 6 3 Process1 0 24 30 6 Average Waiting time is (0+3+6)/3= 3
  • 13. Shortest Job First: Another way to scheduling jobs is to pick the job that will take least amount of time to complete, based on burst size. In this way the average waiting time reduced. •Normal SJF •Non preemptive • Preemptive
  • 16. Non preemptive SJF Example: Process name Arrival time Burst time Process1 0 7 Process2 2 4 Process3 4 2 Process4 5 4
  • 17. Process name Arrival time Burst time Finish time Waiting time Process1 0 7 7 0 Process2 2 4 13 7 Process3 4 2 9 3 Process4 5 4 17 8
  • 18. Process name Arrival time Burst time Process1 0 7 Process2 2 4 Process3 4 1 Process4 5 4 Preemptive SJF Example 2
  • 19. Process name Arrival time Burst time Finish time Waiting time Process1 0 7 16 9 Process2 2 4 7 1 Process3 4 1 5 0 Process4 5 4 11 2
  • 20. Requires that each process should have priority associated with it. Priority scheduling: Priority scheduling Example for Non Preemptive Process name Burst Time Priority Process1 10 3 Process2 1 1 Process3 2 3 Process4 1 4 Process5 5 2
  • 21. Process2 Process5 Process1 Process3 Process4 Priority scheduling Example Preemptive Process name Arrival time Burst time Priority Process1 0 10 3 Process2 2 1 1 Process3 4 2 2 Process4 6 1 4 Process5 8 5 5 Gantt Chart 0 1 6 16 18 ` 19
  • 22. P1 P2 P1 P3 P1 P2 P5 Round robin scheduling Gantt Chart 0 2 3 4 6 13 14 19 Another way to schedule jobs is to assign a small amount of time to each process in which it executes. This time the unite is called time quantum or tie slice, the job is allocated to CPU for the quantum. when the time quantum expires, the process preempted from CPU and replaced by next process in the circle queue.
  • 24. Process name Burst time Process1 24 Process2 3 Process3 3 Gantt Chart P1 P2 P3 P1 P1 P1 P1 P1 0 4 7 10 14 18 22 26 30 (10+7+30)/3=16

Editor's Notes

  • #2: Raeesa imtiaz