SlideShare a Scribd company logo
4
Most read
6
Most read
8
Most read
Shortest job first Scheduling (SJF)
SHORTEST JOB FIRST
 When the CPU is available, it is assigned to the process
that has the smallest CPU burst. Ready queue is treated
as a priority queue based on smallest CPU time
requirement
 Priorities are assigned in inverse order of time needed for
completion of the entire job
 If equal time of completion, then FCFS is used for
assigning priority.
 Dispatcher selects shortest job (1st in queue) and runs to
completion
 Gives minimum average waiting time for a given set of
processes.
 Minimizes average turnaround time.
 It cannot be implemented at the level of short term CPU
scheduling.
 Store estimated value in PCB for the current burst, and
compare with actual value.
 Exponential averaging is used to estimate the process’
burst duration.
 Minimizes average waiting time.
 Provably optimal with respect to average turnaround
time.
 Throughput is high.
 In general, cannot be implemented.
 Requires future knowledge
 In practice, can’t actually predict the length of next
burst
 Can lead to unfairness or starvation
 Doesn’t always minimize average turnaround
time
 Elapsed time (i.e., execution-completed-time)
must be recorded, it results an additional
overhead on the processor.
 Criteria- Burst time
 Mode:- Non-Preemptive
Process No. Arrival Time Burst Time
1 1 7
2 2 5
3 3 1
4 4 2
5 5 8
Process No. Arrival Time Burst Time
1 1 7
2 2 5
3 3 1
4 4 2
5 5 8
Gantt Chart:-
0 1 8
P1
9
P3 P4
11
P2
16
P5
24
Shortest job first Scheduling (SJF)

More Related Content

PPTX
Shortest Job First
PPTX
First Come First Serve & Shortest Job First-(FCFS & SJF)
PPTX
Cpu scheduling
PPT
Scheduling algorithms
PPT
CPU Scheduling Algorithms
PPSX
CPU Scheduling algorithms
PPT
Inter-Process communication in Operating System.ppt
PPTX
Round Robin Scheduling Algorithm
Shortest Job First
First Come First Serve & Shortest Job First-(FCFS & SJF)
Cpu scheduling
Scheduling algorithms
CPU Scheduling Algorithms
CPU Scheduling algorithms
Inter-Process communication in Operating System.ppt
Round Robin Scheduling Algorithm

What's hot (20)

PDF
Process scheduling (CPU Scheduling)
PPT
Priority scheduling algorithms
PPTX
SCHEDULING ALGORITHMS
PPTX
Page replacement algorithms
PDF
NFA to DFA
PPT
Process management in os
PPT
Operating Systems Process Scheduling Algorithms
DOCX
BANKER'S ALGORITHM
PPTX
First-Come-First-Serve (FCFS)
PPTX
Regular expressions
PPTX
Process scheduling
PDF
Memory management
PPTX
Cpu scheduling in operating System.
PPTX
Process scheduling
PPTX
Context switching
PPT
The process states
PPTX
Context free grammar
PPT
Semaphores OS Basics
PPT
Regular expressions-Theory of computation
PPTX
Round Robin Algorithm.pptx
Process scheduling (CPU Scheduling)
Priority scheduling algorithms
SCHEDULING ALGORITHMS
Page replacement algorithms
NFA to DFA
Process management in os
Operating Systems Process Scheduling Algorithms
BANKER'S ALGORITHM
First-Come-First-Serve (FCFS)
Regular expressions
Process scheduling
Memory management
Cpu scheduling in operating System.
Process scheduling
Context switching
The process states
Context free grammar
Semaphores OS Basics
Regular expressions-Theory of computation
Round Robin Algorithm.pptx
Ad

Similar to Shortest job first Scheduling (SJF) (20)

PPTX
Operating systems - Processes Scheduling
PDF
OS Process Chapter 3.pdf
PPTX
Cpu_sheduling.pptx
PPTX
operating system scheduling concept lec2
PPT
OS-operating systems- ch05 (CPU Scheduling) ...
PPTX
Scheduling Algorithms-Examples.pptx
PPTX
UNIPROCESS SCHEDULING.pptx
PPTX
CPU scheduling
PPTX
Process and CPU scheduler
PPT
CPU SCHEDULING IN OPERATING SYSTEMS IN DETAILED
PDF
AlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorit...
PPT
May14ProcessScheduling.ppt
PPT
pscheduling.ppt
PPTX
Cpu scheduling
PPT
Sceduling
PPTX
Week 5a.pptx of cpu scheduling operating system class
PPTX
Study_Material_Presentations_Unit-2.pptx
PPT
Unit2 CPU Scheduling 24252 (sssssss1).ppt
PPT
Unit2 CPU Scheduling 24252.ppBBBBBBBBBBt
PDF
CPU Scheduling
Operating systems - Processes Scheduling
OS Process Chapter 3.pdf
Cpu_sheduling.pptx
operating system scheduling concept lec2
OS-operating systems- ch05 (CPU Scheduling) ...
Scheduling Algorithms-Examples.pptx
UNIPROCESS SCHEDULING.pptx
CPU scheduling
Process and CPU scheduler
CPU SCHEDULING IN OPERATING SYSTEMS IN DETAILED
AlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorit...
May14ProcessScheduling.ppt
pscheduling.ppt
Cpu scheduling
Sceduling
Week 5a.pptx of cpu scheduling operating system class
Study_Material_Presentations_Unit-2.pptx
Unit2 CPU Scheduling 24252 (sssssss1).ppt
Unit2 CPU Scheduling 24252.ppBBBBBBBBBBt
CPU Scheduling
Ad

Recently uploaded (20)

PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
Tartificialntelligence_presentation.pptx
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
SOPHOS-XG Firewall Administrator PPT.pptx
PDF
A comparative analysis of optical character recognition models for extracting...
PPTX
Programs and apps: productivity, graphics, security and other tools
PPTX
Big Data Technologies - Introduction.pptx
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PPTX
MYSQL Presentation for SQL database connectivity
Mobile App Security Testing_ A Comprehensive Guide.pdf
Spectral efficient network and resource selection model in 5G networks
Advanced methodologies resolving dimensionality complications for autism neur...
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
MIND Revenue Release Quarter 2 2025 Press Release
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Unlocking AI with Model Context Protocol (MCP)
Building Integrated photovoltaic BIPV_UPV.pdf
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Tartificialntelligence_presentation.pptx
Network Security Unit 5.pdf for BCA BBA.
Group 1 Presentation -Planning and Decision Making .pptx
The Rise and Fall of 3GPP – Time for a Sabbatical?
SOPHOS-XG Firewall Administrator PPT.pptx
A comparative analysis of optical character recognition models for extracting...
Programs and apps: productivity, graphics, security and other tools
Big Data Technologies - Introduction.pptx
NewMind AI Weekly Chronicles - August'25-Week II
MYSQL Presentation for SQL database connectivity

Shortest job first Scheduling (SJF)

  • 3.  When the CPU is available, it is assigned to the process that has the smallest CPU burst. Ready queue is treated as a priority queue based on smallest CPU time requirement  Priorities are assigned in inverse order of time needed for completion of the entire job  If equal time of completion, then FCFS is used for assigning priority.  Dispatcher selects shortest job (1st in queue) and runs to completion
  • 4.  Gives minimum average waiting time for a given set of processes.  Minimizes average turnaround time.  It cannot be implemented at the level of short term CPU scheduling.  Store estimated value in PCB for the current burst, and compare with actual value.  Exponential averaging is used to estimate the process’ burst duration.
  • 5.  Minimizes average waiting time.  Provably optimal with respect to average turnaround time.  Throughput is high.
  • 6.  In general, cannot be implemented.  Requires future knowledge  In practice, can’t actually predict the length of next burst  Can lead to unfairness or starvation  Doesn’t always minimize average turnaround time  Elapsed time (i.e., execution-completed-time) must be recorded, it results an additional overhead on the processor.
  • 7.  Criteria- Burst time  Mode:- Non-Preemptive Process No. Arrival Time Burst Time 1 1 7 2 2 5 3 3 1 4 4 2 5 5 8
  • 8. Process No. Arrival Time Burst Time 1 1 7 2 2 5 3 3 1 4 4 2 5 5 8 Gantt Chart:- 0 1 8 P1 9 P3 P4 11 P2 16 P5 24