369 views
0 votes
0 votes

Which of the following statements is TRUE ?

S1) If Bounded waiting is guaranteed for a synchronization mechanism,then definitely that solution will be starvation-free.

S2) If a synchronization mechanism is free from starvation,then it definitely guarantees bounded waiting.

Effectively I want to know whether Bounded waiting and starvation freedom are same ...?? If different please explain what is the difference ...

2 Answers

0 votes
0 votes

Bounded waiting means no process should wait for a resource for infinite amount of time where as Starvation means if a process is waiting for a resource for very long interval of time(Finite Time).

Let's assume there are n processes to be executed and let's say from n processes there is a process i which is having the lowest priority, then the i process will go though bounded waiting which means it'll starve, that process is not allowed to get into the Critical Section. So if there is bounded waiting then there will be Starvation too and vice versa.

So if there is bounded waiting then it won't be starvation-free.

0 votes
0 votes

Bounded Waiting:There exists a bound, or limit, on the number of times other processes are allowed to enter their critical sections after a process has made request to enter its critical section  and before that request is granted.

So it implies there has to be a bound in wait after requesting a shared resource till the process obtains that.

Starvation: in general, means a situation where some process has been denied service for a long time or has been repeatedly denied service.

So effectively if there is a bound in wait(finite time,limit) for resource acquisition by the process i.e. bounded wait --no starvation is likely .which makes S1 true.

 Now Starvation can be caused not only by unbounded waiting(infinite /not finitely guaranteed) but also by by resource leaks, and can be intentionally caused via a denial-of-service attack such as a fork bomb. (Ref:https://en.wikipedia.org/wiki/Starvation_%28computer_science%29).

So option S2 does  not always hold.

The answer should be S1 is always true not S2.

Related questions

0 votes
0 votes
1 answer
2
0 votes
0 votes
3 answers
3