1,201 views
1 votes
1 votes

Can Mutual exclusion can be enforced with a general semaphore initial value is greater than 1 ?

I think yes. Consider a semaphore $S = 2$, and following code segment for both processes.

P(S);
P(S);
<Critical Section>
V(S);
V(S);

1 Answer

3 votes
3 votes

Yes Mutual exclusion is guaranteed with s=2.

But this solution also lead to DeadLock.

Related questions

0 votes
0 votes
2 answers
3
shivajikobardan asked Jul 22, 2023
727 views
Sorry if this is a stupid question. But it really intrigued me. Same resources at different algorithms are telling different ways to test these stuffs.Here's an algorith...