0% found this document useful (0 votes)
330 views5 pages

Predicting Burst Time

The document discusses techniques to predict process burst times for Shortest Job First (SJF) scheduling. There are static techniques based on process size or type, and dynamic techniques using simple or exponential averaging of past process burst times. Exponential averaging predicts the burst time for the next process as a weighted average of the last actual burst time and the previously predicted burst time. For example, given a smoothing factor of 0.5, the predicted burst time for the fifth process using exponential averaging is 6.875 time units.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
330 views5 pages

Predicting Burst Time

The document discusses techniques to predict process burst times for Shortest Job First (SJF) scheduling. There are static techniques based on process size or type, and dynamic techniques using simple or exponential averaging of past process burst times. Exponential averaging predicts the burst time for the next process as a weighted average of the last actual burst time and the previously predicted burst time. For example, given a smoothing factor of 0.5, the predicted burst time for the fifth process using exponential averaging is 6.875 time units.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Predicting Burst Time | SJF Scheduling

Operating System

SJF Scheduling-
 
Before you go through this article, make sure that you have gone through the
previous article on SJF Scheduling.
 
In SJF Scheduling,
 Out of all the available processes, CPU is assigned to the process having
smallest burst time.
 The main drawback of SJF Scheduling is that it can not be implemented
practically.
 This is because burst time of the processes can not be known in advance.
 
In this article, we will discuss techniques to predict burst time.
 

Techniques to Predict Burst Time-


 
There are several techniques which try to predict the burst time for the processes so
that the algorithm can be implemented.
These techniques are-
 

Static Techniques-
 
There are two static techniques-
1. Based on process size
2. Based on process type
 

1. Based on Process Size-


 
 This technique predicts the burst time for a process based on its size.
 Burst time of the already executed process of similar size is taken as the burst
time for the process to be executed.
 

Example-
 
 Consider a process of size 200 KB took 20 units of time to complete its
execution.
 Then, burst time for any future process having size around 200 KB can be
taken as 20 units.
 

NOTE
 The predicted burst time may not always be right.
 This is because the burst time of a process also depends on what kind of a process it is.

2. Based on Process Type-


 
 This technique predicts the burst time for a process based on its type.
 The following figure shows the burst time assumed for several kinds of
processes.
 
 

Dynamic Techniques-
 
There are two dynamic techniques-
1. Based on simple averaging
2. Based on exponential averaging
 

1. Based on Simple Averaging-


 
 Burst time for the process to be executed is taken as the average of all the
processes that are executed till now.
 Given n processes P1, P2, … , Pn and burst time of each process Pi as ti, then
predicted burst time for process Pn+1 is given as-
 

2. Based on Exponential Averaging-


 
 Given n processes P1, P2, … , Pn and burst time of each process Pi as ti.
Then, predicted burst time for process Pn+1 is given as-
 
 
where-
 α is called smoothening factor (0<= α <=1)
 tn = actual burst time of process Pn
 Tn = Predicted burst time for process Pn
 

PRACTICE PROBLEM BASED ON PREDICTING


BURST TIME-
 

Problem-
 
Calculate the predicted burst time using exponential averaging for the fifth process if
the predicted burst time for the first process is 10 units and actual burst time of the
first four processes is 4, 8, 6 and 7 units respectively. Given α = 0.5.
 

Solution-
 
Given-
 Predicted burst time for 1st process = 10 units
 Actual burst time of the first four processes = 4, 8, 6, 7
 α = 0.5
 

Predicted Burst Time for 2nd Process-


 
Predicted burst time for 2nd process
= α x Actual burst time of 1st process + (1-α) x Predicted burst time for 1st process
= 0.5 x 4 + 0.5 x 10
=2+5
= 7 units
 
Predicted Burst Time for 3rd Process-
 
Predicted burst time for 3rd process
= α x Actual burst time of 2nd process + (1-α) x Predicted burst time for 2nd process
= 0.5 x 8 + 0.5 x 7
= 4 + 3.5
= 7.5 units
 

Predicted Burst Time for 4th Process-


 
Predicted burst time for 4th process
= α x Actual burst time of 3rd process + (1-α) x Predicted burst time for 3rd process
= 0.5 x 6 + 0.5 x 7.5
= 3 + 3.75
= 6.75 units
 

Predicted Burst Time for 5th Process-


 
Predicted burst time for 5th process
= α x Actual burst time of 4th process + (1-α) x Predicted burst time for 4th process
= 0.5 x 7 + 0.5 x 6.75
= 3.5 + 3.375
= 6.875 units
 

You might also like