Shortest Job First (SJF)


B) Shortest Job First (SJF)  :   In  this method, when the CPU is available it  is assigned  to that job with the smallest next CPU burst. FCFS  is  used. The following example illustrates. The following is the order in  which the jobs arrive and their burst times.
 
The  difficulty  with SJF is knowing the length of  the  next,  CPU burst by predicting. It is done as follows.

   Let Tn  be the length of the nth CPU burst time.
         tn   be the predicted value of the nth CPU burst time.

                Tn+1 =   tn  +  ( 1 - µ ) Tn
                                            
The formula defines an exponential average.

            t  -  Current Burst Time.             
            T - Previous Burst Time.
µ   - Relative Weightage between the Fast and Recent burst times.

 

Monday 1 October 2012

Shortest Job First (SJF)


B) Shortest Job First (SJF)  :   In  this method, when the CPU is available it  is assigned  to that job with the smallest next CPU burst. FCFS  is  used. The following example illustrates. The following is the order in  which the jobs arrive and their burst times.
 
The  difficulty  with SJF is knowing the length of  the  next,  CPU burst by predicting. It is done as follows.

   Let Tn  be the length of the nth CPU burst time.
         tn   be the predicted value of the nth CPU burst time.

                Tn+1 =   tn  +  ( 1 - µ ) Tn
                                            
The formula defines an exponential average.

            t  -  Current Burst Time.             
            T - Previous Burst Time.
µ   - Relative Weightage between the Fast and Recent burst times.