operating-systems scheduling

Definition

Service Time Estimation

Service time estimation is the process of predicting the length of the next CPU burst for a process. This is required for strategies like SPN, SRT, and HRRN.

Mechanism: Exponential Averaging

Since the future behaviour of a process cannot be known with certainty, the OS uses a weighted average of past bursts to predict the next one. Let be the actual length of the -th burst and be the predicted length for the next burst:

  • : The actual length of the most recent burst.
  • : The previous estimate.
  • : The weighting factor ().
    • If is close to 1, the estimate responds quickly to recent changes in behaviour.
    • If is close to 0, the estimate is stable and ignores transient spikes.

Importance

Accurate estimation is crucial because:

  • Fairness: Overestimating a burst might unfairly delay a short process.
  • Starvation: Underestimating might allow a CPU-intensive process to monopolise the processor if the algorithm prioritises shorter bursts.