Predicting Burst Time
Predicting Burst Time
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.
Static Techniques-
There are two static techniques-
1. Based on process size
2. Based on process type
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.
Dynamic Techniques-
There are two dynamic techniques-
1. Based on simple averaging
2. Based on exponential averaging
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