653 views
3 votes
3 votes

Let 'n' processes competing to enter their critical sections and mutex be a global binary semaphore initialized to 1. The process is coded as follows:

Signal(mutex);

     C.S;

wait(mutex);

Which of the following statements are TRUE?

s1: This code ensures mutual exclusion

s2: This code ensures progress

(A) S1 only

(B) S2 only

(C) Both S1 and S2

(D) Neither S1 nor S2

my doubt: 

we can see it doesn't satisfy mutual exclusion. therefore s1 is not true. 

coming to progress, 

Progress is : If no process is executing in its critical section and some processes wish to enter their critical sections, then only those processes that are not executing in their remainder section can participate in deciding which will enter its critical section next, and this selection cannot be postponed indefinitely.

I have the following questions. 

1. when mutual exclusion is failed, does progress hold? since it says about only one process entering c.s in the definition

2.  here, when c.s is free and if a process wants to enter, the decision is not postponed indefinitely and there is no competition to enter as well. can we take this as progress?

Please answer. 

Please log in or register to answer this question.

Related questions

1 votes
1 votes
1 answer
3
Tuhin Dutta asked Oct 8, 2017
983 views
There are two threads which try to solve critical section problem using Test-And-Set instruction.Does the above code prevent deadlock? please provide reason to your answe...