in Operating System
1,732 views
1 vote
1 vote

Q. An SJF algorithm is simply a priority algorithm where the priority is :

A) predicted next cpu burst 

B) The inverse of the predicted next cpu burst 

C) the current cpu burst 

D)anything the user want

so in this what will be the ans it's a) or c) ? I confused with these two options.please gives proper explanation.

in Operating System
by
1.7k views

3 Comments

A) This is the correct answer.SJF is impossible to implement in real life because it requires the knowledge of CPU burst of processes in advance to schedule the processes in increasing order of burst time i.e. low burst time = higher priority
B) Taking the inverse of  predicted next cpu burst will actually reverse the priority if you consider a lower number to be of higher priority.
C) If current CPU burst is taken as priority , the how will CPU decide what to schedule next .
D) This is priority scheduling.
0
0

priority in numbers is like p1>p2 and so on.
in SJF to implement it in practice, we need to predict the BT.
So when predicted BT is low, the process will have the shortest BT, and high priority.

therefore A?

0
0

They not gives this as ans.(initially i also picked this)

Ya sure , we know SJF is not practically implemented due to there is no way to predict the burst time of next process  cpu burst.

Moreover here priority is not big consult in my doubt as we know minimum burst time of a process assigned higher priority in this case.

i mean here they are not asking about the  difficulty of Optimal SJF (as we mentioned above ) i think they just asked the current scenario in which all the process arrived at same time then on what bases we predict the priority. 

Correct me.....

@Shaik Masthan sir...

@manisha11

 

0
0

3 Answers

2 votes
2 votes
Best answer
i hope option c, as predicted current cpu burst

then option c is correct as per me
selected by

1 comment

Thank you sir...there is a little bit confusion that i face here.I don't want to mugging up my concept at this time.
0
0
1 vote
1 vote

Ans is A.

SJF algorithm is practically infeasible as it depends on the predicted burst time

by

2 Comments

reshown by
This is not the answer in answer key.
0
0
Then the ans key is wrong.. :)
2
2
0 votes
0 votes
Not a very well formed question.

In GATE question they specifically mention if higher number mean more priority or lower number.

If its former A is correct, later than its B.

Why not C? We cannot predict actual BT, so we predict the next BT and set priority accordingly.

Related questions

0 votes
0 votes
1 answer
2
0 votes
0 votes
0 answers
4