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); Operating System operating-system deadlock-prevention-avoidance-detection process-synchronization semaphore + – thor asked Sep 25, 2016 thor 1.2k views answer comment Share Follow See all 3 Comments See all 3 3 Comments reply srestha commented Sep 25, 2016 reply Follow Share yes here ME satisfied But is it satisfied for each case? Say S=2 and there are 2 processes. Is here ME satisfied? P(S); P(S) <Critical Section> <Critical Section> V(S); V(S) No , because here we can start both process same time. 0 votes 0 votes thor commented Sep 25, 2016 reply Follow Share if the statement says " Can Mutual exclusion can be enforced with a general semaphore initial value is greater than 1" (not can here). then answer should be yes. 1 votes 1 votes thor commented Sep 25, 2016 reply Follow Share @srestha See this question 0 votes 0 votes Please log in or register to add a comment.
3 votes 3 votes Yes Mutual exclusion is guaranteed with s=2. But this solution also lead to DeadLock. Shubham Pandey 2 answered Sep 25, 2016 Shubham Pandey 2 comment Share Follow See all 3 Comments See all 3 3 Comments reply thor commented Sep 26, 2016 reply Follow Share Well, I think circular wait is necessary condition for deadlock 1 votes 1 votes thor commented Sep 27, 2016 reply Follow Share @Kapilp see this 0 votes 0 votes vijaycs commented Sep 27, 2016 reply Follow Share @hiteshp , yes, Circular wait is necessary condition for deadlock but not sufficient. https://en.wikipedia.org/wiki/Deadlock#Necessary_conditions 0 votes 0 votes Please log in or register to add a comment.