Redirected
1,129 views
1 votes
1 votes

how this solution does not satisfy bounded waiting?

// initially turn = 0
while (turn != 0);
turn = 1
CS
turn = 0

3 Answers

5 votes
5 votes

bounded waiting says that no process should wait for infinite amount of time to enter into CS.....

that is synchronization technique should implement proper mechanism so that all the process has equal share to enter into CS...

now consider your code....

say P1 and p2 are willing to enter into CS....p1 enters but as soon as it leaves CS....it can again occupy the CS...that means there is no compulsion on p1 that after gaining CS once it should not again grab CS...if its able to take CS....it indicate that P1 may take CS always...

so here bounded wait doesn't gurantee...

1 votes
1 votes
if P$_{0}$ enter in critical section then it means that initial value of turn is 0 if P$_{1}$ is waiting to enter in critical section it will enter only when P$_{0}$ is exit from CS let it enter in CS(only after completion of $P_{0}$) first time after execution from CS if it want to enter again then it will re-enter  again and again so there is no any strict alternation  between $P_{0}$ and $P_{1}$ that's why it does not satisfy bounded waiting.
0 votes
0 votes
  • If we take turn=1 then then while condition become true and both of the process never enter into critical section And both will wait for infinite time  . So bounded wating is not satisfy when turn=1.

  • If we  take turn =0 then both of the process can enter into critical section and no posiblites of infinite waiting so when turn =0 then bounded waiting is satisfy.

edited by

Related questions

3 votes
3 votes
0 answers
2
rahul sharma 5 asked Jan 28, 2018
341 views
Can some one give example where bounded waiting satisfies but starvation freedom is not there?I have read Bounded Wait = Starvation freedom is a false implicationPlease s...
2 votes
2 votes
1 answer
3
hacker16 asked Nov 9, 2017
5,323 views
Bounded waiting does not allow:StarvationBusy WaitingA process to wait indefinitely for CSAll of AboveAns - d)Explain Option 1 and 2 ?
1 votes
1 votes
0 answers
4