OS | SJF Scheduling | Exp - 3

os-sjf-scheduling

Short Job First Scheduling in OS

Shortest job first (SJF) or shortest job next, is a scheduling policy that selects the waiting process with the smallest execution time to execute next. SJN is a non-preemptive algorithm.
  • Shortest Job first has the advantage of having minimum average waiting time among all scheduling algorithms.
  • It is a Greedy Algorithm.
  • It may cause starvation if shorter processes keep coming. This problem can be solved using the concept of aging.
  • It is practically infeasible as Operating System may not know burst time and therefore may not sort them. While it is not possible to predict execution time, several methods can be used to estimate the execution time for a job, such as a weighted average of previous execution times. SJF can be used in specialized environments where accurate estimates of running time are available.
Algorithm:
  1. Sort all the processes in increasing order according to burst time.
  2. Then simply, apply FCFS.

Problem Statement

A Multinational company wants to recruit the 04 students from the college. The selection procedure include the two rounds first is the quiz competition, and second round is the Group discussion .the student who will take the less time among the other students will call first for the second round .Compute the average waiting time and Turnaround time.?

No comments:

Powered by Blogger.