Search code examples
multithreadingthread-safetysemaphore

What is the original meaning of P and V operations in a context of a semaphore?


Does anybody know why semaphore operations are called P and V? Every time I read a chapter on semaphores it says something like the following:

In order for the thread to obtain a resource it executes a P operation. And in order for the thread to release a resource it executes a V operation.

What does P and V stand for? Why they are not called wait and signal?


Solution

  • Dijkstra, one of the inventors of semaphores, used P and V. The letters come from the Dutch words Probeer (try) and Verhoog (increment).

    See also: https://cs.nyu.edu/~yap/classes/os/resources/origin_of_PV.html