The semaphore discussed previously is called a counting sempahore . P succeeds only when the semaphore value is 1. V does not change the semaphore value when it is 1.
Binary semaphores are sometimes easier to implement.
Instead we show how counting semaphores can be implemented by binary semaphores, which demonstrates that binary sempahores are as powerful as counting semaphores. Unless otherwise mentioned, a semaphore is to be interpreted as a counting semaphore. Implementing Counting Sempahores using Binary Semaphores We want to implement counting sempahores using binary semaphores as the only synchronization construct, that is, without accessing pcbs, disabling interrupts, etc. We also do not want an implementation that uses busy waiting. Clearly the implementation needs to keep track of the value of S, say in an integer variable S.val.