343 views
0 votes
0 votes

Can somebody please show atleast one example where a synchromnisation mechanism 

" DOESNOT GUARANTEE BOUNDED WAITING BUT STILL IT GUARANTEES STARVATION FREEDOM "

I am not able to find one ..

MY LOGIC : If Bounded waiting is not guaranteed , then it means that after process P1 has requested its interest to enter CS,then there neednot be any bound on the number of times,other processes (say P2) can enter CS making P1 wait.

Now,here P1 is waiting indefinitely (it doesnot know when will it get a chance to enter CS,because when the scheduler schedules P1,CS is not free and when the CS is free,the scheduler is not scheduling P1) . Now here definitely P1 starves right .......?

So can we say that if BOUNDED WAITING IS NOT GUARANTEED, THEN THAT SOLUTION WILL SURELY SUFFER FROM STARVATION ??? Please correct me if I am wrong in understanding of definitions of Bounded waiting,starvation.

1 Answer

0 votes
0 votes

Suppose there are 3 processes, P1, P2, and P3. We define Step 1 …. Step N as this:

  1. For each Step x,  P3, should be let in at most once. 
  2. For each Step N, P1 and P2 can be let in at most N times. 

This scheme ensures that P3 will enter the CS at every Step. Hence, there is no starvation.

However, for each step, P3 can be pushed further form the start. For the first step, P3 should enter after 1 and 2 at max. For step 2, P3 can be in position 5. For step 3, P3 can be at position 7. For step N, P3 can be pushed back to position 2*N+1. As n→ infinity, 2N+1 approaches infinity too. Hence there is no bounded waiting. 

Related questions