• About WordPress
    • WordPress.org
    • Documentation
    • Support
    • Feedback
  • Log In
  • Register
  • Home
  • Courses
  • Past Paper
  • FYP
  • Interview Questions
  • University Events
  • Contact
  • Quiz & Assignment
Cuitutorial
  • Home
  • Courses
  • Past Paper
  • FYP
  • Interview Questions
  • University Events
  • Contact
  • Quiz & Assignment

Operating System

Home » Blog » Shortest Job First Algorithm in operating system

Shortest Job First Algorithm in operating system

  • Posted by saqib
  • Categories Operating System
  • Date December 18, 2022
  • Comments 0 comment

Shortest Job First Algorithm in operating system

  • Shortest job first a non-preemptive, pre-emptive scheduling algorithm.
  • shortest possible waiting time strategy.
  • In Batch systems where the necessary CPU time is known, implementation is easy.
  • In interactive systems where the necessary CPU time is unknown, implementation is impossible
  • The time required for the procedure should be known in advance by the processor.

Given Table process have Execution time and Arrival time,

Waiting time of process:

Process Waiting Time
P0 0 – 0 = 0
P1 5 – 1 = 4
P2 14 – 2 = 12
P3 8 – 3 = 5

Average Wait Time: (0 + 4 + 12 + 5)/4 = 21 / 4 = 5.25

Characteristics of SJF Scheduling 

  • The benefit of using Shortest Job First is that it has the shortest average waiting time out of all scheduling methods.
  • This algorithm is greedy.
  • It may cause starvation if shorter processes keep coming. This problem can be solved using the concept of ageing.
  • OS may not know burst time and may not sort them. While it’s not possible to predict execution time. But several methods used t estimate execution time of job
  • SJF used specialized environment where estimation of running time is available

Algorithm of SJF

  • Sort every procedure in order of arrival time.
  • Then choose the process with the shortest arrival time and burst time.
  • Create a pool of processes that will arrive after the one that has just finished, and then choose the one from the pool that has the least amount of burst time.
  • Share:
author avatar
saqib

Previous post

Constraints in Flutter
December 18, 2022

Next post

Priority Based Scheduling Algorithm in Operating system
December 18, 2022

You may also like

Aging in operating system
6 January, 2023

Aging in operating system In Operating systems, Aging is a scheduling technique used to avoid Starvation. Fixed priority scheduling is a scheduling discipline in which tasks queued for utilizing a system resource is assigned each priority. A task with a …

Starvation in operating system
6 January, 2023

Starvation in operating system It is a problem when the low-priority process gets jammed for a long duration of time because of high-priority requests being executed. A stream of high-priority requests stops the low-priority process from obtaining the processor or …

Dead Lock in operating system
3 January, 2023

Dead Lock in operating system A Deadlock is a situation where each of the computer process waits for a resource which is being assigned to some another process. In this situation, none of the process gets executed since the resource …

Leave A Reply Cancel reply

You must be logged in to post a comment.

admin@cuitutorial.com
Facebook-f Twitter Youtube Linkedin Instagram Stack-overflow Pinterest Github Quora Whatsapp
Courses
  • All Courses
  • Past Paper
  • Final year projects
  • Interview Questions
  • Contact
Important Pages
  • Privacy Policy
  • Terms of Service
  • Cookie Policy
Links
  • University Events
  • Team
Education & learning platform for All Computer science subjects
Final year projects
Past Paper
Interview questions
Programming, C/C++, Asp.net/MVC. Android, MySql, Jquery, Ajax, javascript, Php, Html5, Bootstrap4.
NTS, GAT, PPSC, FPSC

Copyright © 2021 | Cuitutorial