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
Explain about local and global page replacements?
What is a critical section?
Explain an idle thread?
How do I stop blue screen?
Explain the handheld systems. List the issues related to the handheld system.
Difference between NTFS and FAT32?
Explain briefly about linker and its functioning?
Explain what is the memory wall problem?
Explain page fault interrupt?
Can you please explain the difference between trap and trapdoor?
What are the deadlock avoidance schemes?
How do you exit a screen?
What are the various capacities in which a ram is available?
How do I know chkdsk is finished?
Is it safe to delete ost file?