577 views
1 votes
1 votes

getting A) given D)

1 Answer

Best answer
1 votes
1 votes

Yes, D should be Answer

S1: Consider the situation when a process P1 enters, looked at lock=0, going to make lock=ture, suddenly preempted. Other process P2 comes looked at lock, Oh.. it is still false, going to make lock=true.. success; go to Critical section. When P1 again came and start execution from where it has left i,e make lock=true (instead of checking lock, bcz already done). Enters Critical Section; - success - So, No mutual exclusion

S2: There is no strict rule of FIFO or something, So after leaving CS a process make lock=false, and after that same process may go to CS again and again, It is not compulsory that other want to go CS so i should wait. There may be starvation and hence no BW.

S3: No deadlock.

selected by

Related questions

0 votes
0 votes
0 answers
1
Raj Singh 1 asked Jan 1, 2019
1,385 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...
0 votes
0 votes
0 answers
3
Akash Kumar Roy asked Mar 31, 2018
275 views
Is context switch allowed when a process is in the cirtical section? (Not preemption)If yes then how it deals with data inconsistency?