1,902 views
0 0 votes
why SJF scheduling algorithm frequently used in long term scheduling.

1 Answer

1 1 vote
The SJF scheduling algorithm is probably optimal, in that it provides the minimum average waiting time for a given set of processes. Moving short processes before a long one reduces the waiting time of the short process more than it creases the waiting time of the long process so consequently, the average waiting time decreases. The real problem with the SJF algorithm knows the length of the next CPU request.
 
 
  • For long-term (job) scheduling in a batch system, we can use as the length the process time limit that a user specifies when he submits the job.

 

  • Thus, users are motivated to estimate the process time limit accurately, since a lower value may mean faster response. (Too low a value will cause a time-limit-exceeded error and require resubmission.)

 

  • SJF scheduling is used frequently in long-term scheduling.

 

  • Although the SJF algorithm is optimal, it cannot be implemented at the level of short-term CPU scheduling.

 

  • With short-term scheduling, there is no way to know the length of the next CPU burst.

 

  • One approach is to try to approximate SJF scheduling.

 

  • We may not know the length of the next CPU burst, but we may be able to predict its value.

 

  • We expect that the next CPU burst will be similar in length to the previous ones.

 

  • By computing an approximation of the length of the next CPU burst, we can pick the process with the shortest predicted CPU burst.

 

  • The next CPU burst is generally predicted as an exponential average of the measured lengths of previous CPU bursts. We can define the exponential average with the following formula.

 

                                                τn+1 =    α*tn + (1 - α)*τ

                                                           

 

 

 

 

• edited by
Position:
Show:

Related questions

0 0 votes
0 0 answers
761
761 views
sreenivas.s1995 asked Jan 31, 2019
761 views
Does increasing number of threads decrease total waiting time of the process in terms of round robin scheduling or does it remain the same?Can you please explain why
3 3 votes
0 0 answers
948
948 views
ADITYA CHAURASIYA 5 asked Jan 12, 2018
948 views
Consider a disk system with 101(0 to 100) cylinders. The requests to access cylinders occurs in sequence as:15, 75, 49, 65, 93, 80, 10If the head is currently at 60. What...
2 2 votes
0 0 answers
958
958 views
ADITYA CHAURASIYA 5 asked Jan 9, 2018
958 views
0 0 votes
0 0 answers
759
759 views
sreenivas.s1995 asked Jan 30, 2019
759 views
Which phase of the compiler detects the error?#include<stdio.h>int main(){printf(“%d”,2..3);return 0;}I think lexical analyzer am i correct?