in Operating System recategorized by
2,211 views
2 votes
2 votes

Starvation can be avoided by which of the following statements:

  1. By using shortest job first resource allocation policy .
  2. By using first come first serve resources allocation policy.
  1. (i) only
  2. (i) and (ii) only
  3. (ii) only
  4. None of the options
in Operating System recategorized by
by
2.2k views

3 Answers

4 votes
4 votes

I think of option (D) none of the options is correct.

For shortest time first, process with high burst time will starve. 

While for first come first serve, if the very first process has very large burst time say 1000 while other arriving process have very low burst time say 1. then they have to wait for very long time for first process to be completed and therefore starve. Therefore none of the above two can avoid starvation

Edit : Thanks @Kshitij_Kumre for pointing out my mistake.

So the point that is need to be understood here is the definition of starvation, starvation means “INDEFINITE waiting”  means "we don't know how much time we should wait".  In algorithm like SJF, the waiting time for processes with large burst time cannot be determined as several processes with low burst time may keep coming and therefore it is indefinite. This waiting time can be very long and is indefinite, therefore starvation.

But for FCFS although the waiting time can be very large if the first or early process have large burst time [The phenomenon is also known as convoy effect], but still it is not indefinite because we can always calculate it for any given process as the sum of burst time of all the process before it and therefore cannot be considered as starvation. 

So the correct answer is Option (C) (ii) only.

edited by
by

2 Comments

No, you are wrong. Please study about CPU Scheduling carefully.
Ref. to Galvin book, where it is written that FCFS Scheduling has No Starvation.
All Jobs get their chance as per they are arrived. This does not mean starvation!
Instead, SJF causes starvation to shorter jobs, because some process may get so unlucky
that it may not get chance to be scheduled because of its larger burst time.
1
1
@Kshitij_Kumre thanks, corrected my answer.
0
0
1 vote
1 vote
Option C is correct.

In case of shortest job first policy, it causes Starvation with for the job with highest burst time if shorter jobs keep coming into.

1 comment

A large initial job will starve shorter jobs which arrive late. FCFS isn’t fesiable either.
0
0
1 vote
1 vote

Here option (C) is correct.

→ For SJF  process with highest burst time causes starvation while it comes befor the process with shortest burst time.

→ In  FCFS  , if process  P1 having very  large burst time comes before the process P2 having very  low burst time then according to FCFS P1 will  shedule first and P2 will wait for long time.So this condition called CONVAY EFFECT. For this condition we can not say starvation.

NOTE→ STARVATION  will cause  when  process will be BIASED.

 

Answer:

Related questions