CREATE OWN LIBRARY

Disadvantage and Prediction Techniques:

 

SJF

Advantages

Disadvantages

  • Maximum throughput
  • minimum avg. WT & TAT
  • Starvation to larger jobs
  • It is not implementable because the Burst Time of the processes can't be known ahead.

 

Solution: 

OS may not know the length of the next burst time, but OS may be able to predict the burst time of processes to implement the SJF scheduling algorithm.

 

Prediction techniques

Static

Dynamic

1.   Process Size

2.   Process type

1.  Simple Averaging

2.  Exponential Averaging

 

Static

 

(i) Process Size (Bytes)

Burst time of the new process can be predicted from the old process with a similar size. 

 

(ii) Process Type:

 

                       

As per the process type, the operating system can predict the burst time of the new process.

 

Dynamic:

 

(i) Simple Averaging:

This is a simple method to predict the burst time of a new process by calculating the average of all burst time of the completion process.

 

  • Given n-processes  (P1, P2, ...... Pn)
  • Let ti  be the actual BT
  • Let Ti denotes the predicted BT

 

(ii) Exponential Average: 

The next burst is generally predicted as an exponential average of CPU the measured lengths of the previous burst CPU. We can define the exponential average with the following formula. Let tn be the length of the nth CPU burst, and let Tn+1 be our predicted value for the next CPU burst. Then, for α, 0 ≤ α ≤1, define

 

        

 

The value of tncontains our most recent information, while stores the past Tnhistory. The parameter α controls the relative weight of recent and past history in our prediction. If α = 0, then Tn+1 = Tn, and recent history has no effect (current conditions are assumed to be transient). If α = 1, then Tn+1 = tn and only the most recent burst matters (history is assumed to be old and irrelevant). More commonly, α = 1/2, so recent history and past history are equally weighted. The initial T1 can be defined as a constant or as an overall system average. In our example below, an exponential average with 1/2 and T1= 10. To understand the behavior of the exponential average, we can expand the formula for Tn+1 by substituting for Tn to find

 

 

Example:

 

ti = processor execution time for ith instance of this process (total execution time for the batch process (job); processor burst time for the interactive job).

Ti = Predicted value for the ith instance.

T1 = Predicted value for the first instance; not calculate

 

(First prediction; not calculate)

 

Actual Burst Time (t1, t2, t3, t4, t5, t6, t7) = (6, 4, 6, 4, 13, 13, 13)

Then t6 = ?

 

Answer: 

 

 

 

 

 

 

 

 

Fig: 17

 

But Practically SJF is not used and the Round Robin Scheduling algorithm is the most practical.