What is a binary semaphore? What is its use?

Answer Posted / ashaa

The semaphore discussed previously is called a counting sempahore. Another kind of semaphore is the binary semaphore; This is exactly like a counting semaphore except for the following:
the semaphore value is restricted to 0 and 1.
P succeeds only when the semaphore value is 1.
V does not change the semaphore value when it is 1. (Thus successive Vs are lost.)

Binary semaphores are sometimes easier to implement. than counting semaphores. We will not describe implementations of binary semaphores in terms of low-level or OS constructs (these would be similar to the implementations of counting semaphores). Instead we show how counting semaphores can be implemented by binary semaphores, which demonstrates that binary sempahores are as powerful as counting semaphores.
Convention: Unless otherwise mentioned, a semaphore is to be interpreted as a counting semaphore.

Is This Answer Correct ?    4 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

much time is spent usually in each phases and why?

613


How do you change File Access Permissions?

619


What is the shortest definition of os?

628


Hi Freinds, Any body is wotking as System Administrator, Please mail me rakesh.kesh881@gmail.com

1743


What is trp timing?

648






What are the different raid levels?

625


What do you mean by memory leak?

629


What is synchronization? What are the different synchronization mechanisms?

546


Explain the main purpose of an operating system?

610


Which is the fastest operating system?

559


what is difference between xp & 2003?

1542


How does the system detect thrashing?

664


What is ex and vi?

606


Explain booting the system in operating system.

587


What are the basic operations?

607