A semaphore is a non-negative integer with two atomic operations: (sem_wait) waits until the value is positive and decreases it by 1; (sem_post) increases it by 1, waking a waiter if there is one. A semaphore that starts at counts available resources.
Computer Science · Glosarium