1,051 views
1 1 vote

getting A) given D)

1 Answer

Best answer
1 1 vote

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
Position:
Show:

Related questions

4 4 votes
1 1 answer
160
160 views
GO Classes asked Aug 29
160 views
For a correct mechanism controlling entry into a critical section, consider the following requirements:Two processes must not execute simultaneously inside their critical...
0 0 votes
0 0 answers
3.0k
3.0k views
Raj Singh 1 asked Jan 1, 2019
3,047 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...
4 4 votes
3 3 answers
7.5k
7.5k views
Na462 asked Jul 18, 2018
7,469 views
Consider the following code to solve the critical section problem for two processes P0 and P1. Initially flag [i] contain false for i = 0 and 1.Assume i refers to the cur...
0 0 votes
0 0 answers
672
672 views
Akash Kumar Roy asked Mar 31, 2018
672 views
Is context switch allowed when a process is in the cirtical section? (Not preemption)If yes then how it deals with data inconsistency?