No this cannot solve the critical section problem for the following reason.
If one process does "while(flag[(i+1)mod2])", gets interrupted immediately afterward, then the other process does the same thing, then they both go on to do “flag[i]=TRUE” and enter their critical sections at the same time, violating Mutual Exclusion
Friend, That was
a nice question to answer
If you have any doubts in understanding do let me know in the
comment section. I will be happy to help you further.
Please like it if you think effort deserves like.
Thanks
Get Answers For Free
Most questions answered within 1 hours.