SlideShare a Scribd company logo
1 of 24
 Maximum CPU utilization obtained with multiprogramming.
 Scheduling :- A method of assigning CPU to a process.
 Scheduling is the basis of multi-programmed OS.
 A module that selects a process, for assigning CPU to it .
 It Involves 2 Steps : Switching Context.
 Jumping to the proper location in the
program to re-start the program.

 Dispatch Latency :- Time it takes for the dispatcher to

stop one process and start another
running.
 Non-Preemptive Scheduling

Once A process is allocated the CPU, it does not leave
unless :-

 It has to wait for an I/O request.
 It terminates.

 Preemptive Scheduling

OS can force (preempt) A process from CPU at
anytime. For example : To allocate CPU to another higher priority

processes.
 Due to end of time slice.
1. When A process switches from the running state to waiting state

( due to an I/O request ).

2. When A process switches from the running state to ready state (
due to end of time slice ).
3. When A process switches from the waiting state to ready state (

at completion of I/O ).
4. When A process terminates.
CPU Utilization – Keep the CPU as busy as possible.

Throughput – Number of processes that complete their execution per
time unit.
Turnaround Time – Amount of time to execute A particular process.
Waiting Time – Amount of time A process has been waiting in the
ready queue.
Response Time – Amount of time it takes from when A request was
submitted until the first response is produced, not
output (for time-sharing environment).
First-Come-First-Served Scheduling
Round-Robin Scheduling
Priority Scheduling
Shortest-Job-First Scheduling
Simplest algorithm.
Non-preemptive.
Processes assigned in the order they request.
Single queue of ready processes .
FIFO queue structure.
When the process joins the ready queue , it is linked to
the tail of the FIFO queue.
When the CPU is idle, the process at the head of the
FIFO queue is allocated to the CPU and deleted from the
queue.
Process

Burst Time(ms)

P1

24

P2

3

P3

3
P1

0

P2
24

P3
27

30

Chart 1
Average waiting time = 17 ms
Average turnaround time = 27 ms
P2
0

P3
3

P1
6
Chart 2

Average waiting time = 3 ms
Average turnaround time = 13 ms

30
ADVANTAGES
Easy to understand.
Easy to program.
Single queue keeps track of all ready
processes.
Picking a process to run, just requires
removing one from the head of the queue.
Adding a new process or unblocked process
just requires attaching it to the tail of the queue.
DISADVANTAGES
The average waiting time is often quite long .
Its average waiting time varies if the CPU
burst times vary greatly.
Small process wait for one big process.
Not suited for time sharing systems.
Designed for time sharing systems.
Preemptive.
Process assigned a time interval, called quantum.
CPU scheduler allocates each process in the ready queue
one time slice at a time.
Follow FIFO queue structure.
Processes allocated to the CPU may have the current CPU
burst:1. equal to the time slice
2. smaller than the time slice
3. greater than the time slice

In first two cases, process will release the CPU by its own.
In the third case, the current process is preempted.
Process

Burst time (ms)

P1

24

P2

3

P3

3

Duration of time slice = 4 ms
P1

0

P2

4
Waiting time,

P3

7

P1

10

P1

14

P1

18

P1 = 0 + (10 – 4)
P2 = 4
P3 = 7

Average waiting time = 17/3
= 5.66 ms

P1

22

P1

26

30
ADVANTAGES
Simple and easy to implement.
Each processes get equal chance to execute.
Handling all processes without priority.
Starvation free.

DISADVANTAGES
Depend upon the length of the time slice.
Same as FCFS, if time slice is indefinitely large.
Small time slice will deteriorates due to frequent context
switching.
► A priority number (integer) is associated with each process.

► Smallest integer ≡ Highest priority.
► The CPU is allocated to the process with highest priority.
► Can be Preemptive or Non-preemptive.
► Equal priority processes are scheduled on FCFS.
Process

Priority

Burst time (ms)

P1

3

10

P2

1

1

P3

3

2

P4

4

1

P5

2

5

P2
0

P5
1

P1
6

P3
16

P4
18

19

Chart 1

Average waiting time = (6+0+16+18+1) / 5 = 41/5 =8.2 ms
DISADVANTAGES
►If system eventually crashes, all low priority processes get lost.
► Indefinite blocking or Starvation.

ADVANTAGES
► Aging :- As time increases , increase in the priority of a process.
► Simplicity.
► Suitable for applications with varying time and resource
requirement.
► Length of CPU burst of each process is considered.

► Process with the smallest CPU burst, will be executed first.

► In case of tie between processes, FCFS is used.
► SJF is optimal :- Gives minimum average waiting time for a
given set of processes.
Process

Arrival time (ms)

Burst time (ms)

P1

0

8

P2

1

4

P3

2

9

P4

3

5

 SJF Preemptive Scheduling,
P1

0

P2

1

P4

P1

P3

5

10
Chart 1
Average waiting time = 6.5 ms

17

26

 SJF Non-preemptive scheduling,
P1
0

P2
8

P4

12
Chart 2
Average waiting time = 7.75 ms

P3
17

26
ADVANTAGES
► Produces the minimum average turnaround time.

► Reduces average waiting time.

DISADVANTAGES
► Accurate length of CPU burst is not known.
► Some risk of Starvation for longer processes.
Maximizing CPU Utilization Through Efficient Scheduling Algorithms
Maximizing CPU Utilization Through Efficient Scheduling Algorithms

More Related Content

What's hot

What's hot (20)

Operating Systems Process Scheduling Algorithms
Operating Systems   Process Scheduling AlgorithmsOperating Systems   Process Scheduling Algorithms
Operating Systems Process Scheduling Algorithms
 
Process scheduling (CPU Scheduling)
Process scheduling (CPU Scheduling)Process scheduling (CPU Scheduling)
Process scheduling (CPU Scheduling)
 
Cpu scheduling in operating System.
Cpu scheduling in operating System.Cpu scheduling in operating System.
Cpu scheduling in operating System.
 
Process Scheduling
Process SchedulingProcess Scheduling
Process Scheduling
 
Scheduling
SchedulingScheduling
Scheduling
 
5 Process Scheduling
5 Process Scheduling5 Process Scheduling
5 Process Scheduling
 
SCHEDULING ALGORITHMS
SCHEDULING ALGORITHMSSCHEDULING ALGORITHMS
SCHEDULING ALGORITHMS
 
Shortest Job First
Shortest Job FirstShortest Job First
Shortest Job First
 
Process scheduling
Process schedulingProcess scheduling
Process scheduling
 
Operating system 31 multiple processor scheduling
Operating system 31 multiple processor schedulingOperating system 31 multiple processor scheduling
Operating system 31 multiple processor scheduling
 
17 cpu scheduling and scheduling criteria
17 cpu scheduling and scheduling criteria 17 cpu scheduling and scheduling criteria
17 cpu scheduling and scheduling criteria
 
CPU Scheduling in OS Presentation
CPU Scheduling in OS  PresentationCPU Scheduling in OS  Presentation
CPU Scheduling in OS Presentation
 
Priority scheduling algorithms
Priority scheduling algorithmsPriority scheduling algorithms
Priority scheduling algorithms
 
Mainframe systems
Mainframe systemsMainframe systems
Mainframe systems
 
Deadlocks in operating system
Deadlocks in operating systemDeadlocks in operating system
Deadlocks in operating system
 
operating system structure
operating system structureoperating system structure
operating system structure
 
Process management in os
Process management in osProcess management in os
Process management in os
 
First Come First Serve
First Come First ServeFirst Come First Serve
First Come First Serve
 
Real-Time Scheduling
Real-Time SchedulingReal-Time Scheduling
Real-Time Scheduling
 
Priority Scheduling
Priority Scheduling  Priority Scheduling
Priority Scheduling
 

Similar to Maximizing CPU Utilization Through Efficient Scheduling Algorithms

Similar to Maximizing CPU Utilization Through Efficient Scheduling Algorithms (20)

Operating System-Process Scheduling
Operating System-Process SchedulingOperating System-Process Scheduling
Operating System-Process Scheduling
 
Operating System Scheduling
Operating System SchedulingOperating System Scheduling
Operating System Scheduling
 
Scheduling algo(by HJ)
Scheduling algo(by HJ)Scheduling algo(by HJ)
Scheduling algo(by HJ)
 
CPU Scheduling
CPU SchedulingCPU Scheduling
CPU Scheduling
 
Cpu Scheduling Galvin
Cpu Scheduling GalvinCpu Scheduling Galvin
Cpu Scheduling Galvin
 
Preemptive process example.pptx
Preemptive process example.pptxPreemptive process example.pptx
Preemptive process example.pptx
 
Cpu scheduling
Cpu schedulingCpu scheduling
Cpu scheduling
 
Unit 2 notes
Unit 2 notesUnit 2 notes
Unit 2 notes
 
CPU scheduling
CPU schedulingCPU scheduling
CPU scheduling
 
chapter 5 CPU scheduling.ppt
chapter  5 CPU scheduling.pptchapter  5 CPU scheduling.ppt
chapter 5 CPU scheduling.ppt
 
Ch5
Ch5Ch5
Ch5
 
Chapter 2 (Part 2)
Chapter 2 (Part 2) Chapter 2 (Part 2)
Chapter 2 (Part 2)
 
CPU Scheduling
CPU SchedulingCPU Scheduling
CPU Scheduling
 
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
 
Os unit 2
Os unit 2Os unit 2
Os unit 2
 
Fcfs and sjf
Fcfs and sjfFcfs and sjf
Fcfs and sjf
 
Window scheduling algorithm
Window scheduling algorithmWindow scheduling algorithm
Window scheduling algorithm
 
Cp usched 2
Cp usched  2Cp usched  2
Cp usched 2
 
OSCh6
OSCh6OSCh6
OSCh6
 
OS_Ch6
OS_Ch6OS_Ch6
OS_Ch6
 

Recently uploaded

Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfMahmoud M. Sallam
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentInMediaRes1
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...jaredbarbolino94
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxUnboundStockton
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementmkooblal
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxJiesonDelaCerna
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 

Recently uploaded (20)

Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdf
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media Component
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docx
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of management
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptx
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 

Maximizing CPU Utilization Through Efficient Scheduling Algorithms

  • 1.
  • 2.  Maximum CPU utilization obtained with multiprogramming.  Scheduling :- A method of assigning CPU to a process.  Scheduling is the basis of multi-programmed OS.
  • 3.
  • 4.
  • 5.  A module that selects a process, for assigning CPU to it .  It Involves 2 Steps : Switching Context.  Jumping to the proper location in the program to re-start the program.  Dispatch Latency :- Time it takes for the dispatcher to stop one process and start another running.
  • 6.  Non-Preemptive Scheduling Once A process is allocated the CPU, it does not leave unless :-  It has to wait for an I/O request.  It terminates.  Preemptive Scheduling OS can force (preempt) A process from CPU at anytime. For example : To allocate CPU to another higher priority processes.  Due to end of time slice.
  • 7. 1. When A process switches from the running state to waiting state ( due to an I/O request ). 2. When A process switches from the running state to ready state ( due to end of time slice ). 3. When A process switches from the waiting state to ready state ( at completion of I/O ). 4. When A process terminates.
  • 8. CPU Utilization – Keep the CPU as busy as possible. Throughput – Number of processes that complete their execution per time unit. Turnaround Time – Amount of time to execute A particular process. Waiting Time – Amount of time A process has been waiting in the ready queue. Response Time – Amount of time it takes from when A request was submitted until the first response is produced, not output (for time-sharing environment).
  • 10. Simplest algorithm. Non-preemptive. Processes assigned in the order they request. Single queue of ready processes . FIFO queue structure. When the process joins the ready queue , it is linked to the tail of the FIFO queue. When the CPU is idle, the process at the head of the FIFO queue is allocated to the CPU and deleted from the queue.
  • 11. Process Burst Time(ms) P1 24 P2 3 P3 3 P1 0 P2 24 P3 27 30 Chart 1 Average waiting time = 17 ms Average turnaround time = 27 ms P2 0 P3 3 P1 6 Chart 2 Average waiting time = 3 ms Average turnaround time = 13 ms 30
  • 12. ADVANTAGES Easy to understand. Easy to program. Single queue keeps track of all ready processes. Picking a process to run, just requires removing one from the head of the queue. Adding a new process or unblocked process just requires attaching it to the tail of the queue.
  • 13. DISADVANTAGES The average waiting time is often quite long . Its average waiting time varies if the CPU burst times vary greatly. Small process wait for one big process. Not suited for time sharing systems.
  • 14. Designed for time sharing systems. Preemptive. Process assigned a time interval, called quantum. CPU scheduler allocates each process in the ready queue one time slice at a time. Follow FIFO queue structure. Processes allocated to the CPU may have the current CPU burst:1. equal to the time slice 2. smaller than the time slice 3. greater than the time slice In first two cases, process will release the CPU by its own. In the third case, the current process is preempted.
  • 15. Process Burst time (ms) P1 24 P2 3 P3 3 Duration of time slice = 4 ms P1 0 P2 4 Waiting time, P3 7 P1 10 P1 14 P1 18 P1 = 0 + (10 – 4) P2 = 4 P3 = 7 Average waiting time = 17/3 = 5.66 ms P1 22 P1 26 30
  • 16. ADVANTAGES Simple and easy to implement. Each processes get equal chance to execute. Handling all processes without priority. Starvation free. DISADVANTAGES Depend upon the length of the time slice. Same as FCFS, if time slice is indefinitely large. Small time slice will deteriorates due to frequent context switching.
  • 17. ► A priority number (integer) is associated with each process. ► Smallest integer ≡ Highest priority. ► The CPU is allocated to the process with highest priority. ► Can be Preemptive or Non-preemptive. ► Equal priority processes are scheduled on FCFS.
  • 19. DISADVANTAGES ►If system eventually crashes, all low priority processes get lost. ► Indefinite blocking or Starvation. ADVANTAGES ► Aging :- As time increases , increase in the priority of a process. ► Simplicity. ► Suitable for applications with varying time and resource requirement.
  • 20. ► Length of CPU burst of each process is considered. ► Process with the smallest CPU burst, will be executed first. ► In case of tie between processes, FCFS is used. ► SJF is optimal :- Gives minimum average waiting time for a given set of processes.
  • 21. Process Arrival time (ms) Burst time (ms) P1 0 8 P2 1 4 P3 2 9 P4 3 5  SJF Preemptive Scheduling, P1 0 P2 1 P4 P1 P3 5 10 Chart 1 Average waiting time = 6.5 ms 17 26  SJF Non-preemptive scheduling, P1 0 P2 8 P4 12 Chart 2 Average waiting time = 7.75 ms P3 17 26
  • 22. ADVANTAGES ► Produces the minimum average turnaround time. ► Reduces average waiting time. DISADVANTAGES ► Accurate length of CPU burst is not known. ► Some risk of Starvation for longer processes.