1,368 views

2 Answers

0 votes
0 votes

There is no ME, right? Before entering CS,

turn = i would be executed. 

That means other process can enter CS as well. 

0 votes
0 votes
This is a correct solution to the critical section problem.

Reason:-

satisfies  mutual exclusion :-value of turn can be either i or j at the same time so any one process can be in cs.

satisfies progress-after execution of each process its flag is set to false (see in the exit section) .as this flag goes to f other waiting process whose flag value is 1(process interested to enter cs) will enter the cs as while loop condition satisfies in this sitiuation.

bounded waiting-after completing its execuion in cs its flag is set to false which allow other process to enter the cs .the same process cant be executed again and again indefinetly if other process is ready and waiting.

Related questions

0 votes
0 votes
0 answers
2
Raj Singh 1 asked Jan 1, 2019
1,429 views
Many problems on gateoverflow asks whether the given code satisfies progress requirement of the solution for the critical section problem. Most of these code contain mult...