What do you mean by semaphore?
Semaphore: A synchronization variable that acquires on positive integer values. Invented by the Dijkstra
- P (semaphore): an atomic process that waits for semaphore to turn into positive then decrements it by 1.
- V (semaphore): It is an atomic process that increments semaphore by 1.
The names arrive from the Dutch, verhogen (increment) and proberen (test). Semaphores are elegant and easy and permit the solution of many interesting problems. They do many more than just mutual exclusion.