0
votes

In SJF Algorithm, we predict the next CPU Burst time using the formula: τ(n+1) = α*t(n) + (1-α)*τ(n). And then we select the process with the shortest predicted burst time. Now my question is: do we already have an idea about the CPU burst times of the processes arriving? If yes, then why predict the CPU burst time? We could rather just use the shortest time process for scheduling. If no i.e., we do not have any idea about the burst times of the processes, how is the predicted burst time τ(n+1) helping us to pick a process? Hope I am able to explain my confusion. Thanks.

1
I think process BT is not known, cannot be known but we can always predict the aprrox BT based on size,priority,type (i.e. IO or CPU bound) and select the corresponding process given the predicted BT.majumderS

1 Answers

0
votes

The answer is in the question itself. The later condition is true we don't have an idea about burst time of incoming processes this is the reason that we are predicting their burst time τ(n+1). Our prediction may not be 100% right all the time but it'll server the purpose of SJF to a very great extent ! I hope you would've coded this and saw the results if not then i recommend to do so, it'll help a lot understanding this. This is the application I developed, for my teacher, on some scheduling techniques.enter image description here