1 votes 1 votes A binary semaphore ensures mutual exclusion. Does a counting semaphore ensure mutual exclusion too? Please justify your answers. Operating System semaphore process-synchronization operating-system + – dirac asked Nov 13, 2015 dirac 1.6k views answer comment Share Follow See 1 comment See all 1 1 comment reply Umang Raman commented Nov 13, 2015 reply Follow Share i think even binary semaphore cant ensure mutual exclusion wrong use of it can violate. 2 votes 2 votes Please log in or register to add a comment.
Best answer 3 votes 3 votes Yup improper use of semaphore not ensure the mutual exclusion . only proper use of semaphore ensure mutual exclusion. ex: monitor. Prashant. answered Nov 13, 2015 • selected Dec 30, 2015 by Himanshu1 Prashant. comment Share Follow See 1 comment See all 1 1 comment reply mcjoshi commented Sep 18, 2016 reply Follow Share Please elaborate ... 0 votes 0 votes Please log in or register to add a comment.
1 votes 1 votes Counting semaphore can be used to implement mutual exclusion by setting variable 'value' = 1 // value indicate number of processes allowed to enter CS tiger answered Sep 17, 2016 tiger comment Share Follow See all 4 Comments See all 4 4 Comments reply mcjoshi commented Sep 18, 2016 reply Follow Share does binary semaphore always implies mutual exclusion ? 0 votes 0 votes tiger commented Oct 2, 2016 reply Follow Share as binary semaphore has values 0 and 1 , it always implies mutual exclusion 0 votes 0 votes Vijay Thakur commented Oct 12, 2016 reply Follow Share "as binary semaphore has values 0 and 1 , it always implies mutual exclusion" It's wrong conclusion, it depends on implementation, apply only up operation no down operation, n number of process can go in CS 2 votes 2 votes ankit3009 commented Dec 8, 2021 reply Follow Share @Vijay agreed. Consider n binary semaphores initialized to 1 for n number of processes. Here @tiger implication goes incorrect. 0 votes 0 votes Please log in or register to add a comment.