SJF CPU Scheduling

SJF CPU Scheduling :

  • In Shortest Job First  ( SJF CPU Scheduling ), when CPU is free, it is allocated to the process with smallest next burst time.
  • If burst time of two process is same, then FCFS is used to break the tie.
  • It is better than FCFS as it gives minimum average waiting time.
  • The SJF scheduling is especially appropriate for batch system for which the burst times are known in advance.
  • It is difficult to implement as burst time of the next process should be known in advance.
  • SJF is non preemptive therefore, it is not useful in timesharing environment in which reasonable response time must be guaranteed.
  • Short jobs are given more priority over longer ones.

C SOURCE CODE :

OUTPUT  :

sjf cpu scheduling

Leave a Reply

Your email address will not be published. Required fields are marked *