1,623 views
3 votes
3 votes
DOES STRICT ALTERNATION APPROACH SATISFY BOUNDED WAITING CONDITION??

INT TURN;(RANDOMLY ASSIGNED)

---P1----     

WHILE(TURN !=0);

CRITICAL SECTION...

TURN=1;

---P2---

WHILE(TURN!=1);

CRITICAL SECTION

TURN=0;

PS: Though this methods has strict alternation but if the process which has its turn to enter CS, doesnt want to enter the critical section , it will never ever give a chance to another process to enter CS, hence progress violated. But what about bounded wait condition ?? It also fails right??

3 Answers

Best answer
1 votes
1 votes
Bound and waiting is independent of progress. Strict alteration definitely satisfy the bound and waiting and even the bound and waiting will be 1.
selected by
0 votes
0 votes
I THINK  STRICT ALTERNATION APPROACH DOES NOT SATISFY BOUNDED WAITING CONDITION
0 votes
0 votes

If process 1 gets the turn and enters into critical section and after completion if it's preempted then when P2 tries to enter then it can't right .so from this point  P2 don't know how much time to wait .so ,i think we can conclude that strict alteration  enters into UNBOUNDED WAITING 

Related questions

0 votes
0 votes
1 answer
1
N3314nch41 asked Sep 10, 2023
357 views
How to approach synchronization (specifically semaphore) question, there size are really intimidating and i’m unable to decode the code written? What to do??