Semaphores

A semaphore can hold a value from 0 to n. If n is 1, then the semaphore is called a binary semaphore. Otherwise, it is a counting semaphore. A binary semaphore is semantically equivalent to a MUTEX. There are two operations a task can perform on a semaphore: wait (also called the P operation for historical reasons) and signal (also called the V operation for historical reasons).