Semaphore operations


How to remember semaphore operations P(S) and V(S),I always have the confusion which one increments and which one decrements the value of semaphore.


The canonical names V and P come from the initials of Dutch words. V is generally explained as verhogen (“increase”). Several explanations have been offered for P, including proberen (“to test” or “to try”),[3] passeren (“pass”), and pakken (“grab”). Dijkstra’s earliest paper on the subject[1] gives passering (“passing”) as the meaning for P,so you can remember P for passing,when a process gets passed to access a resource when it decreases the value of semaphore.The passing /acquiring of resource happens only after decrementing the value of semaphore.So P for passing,passing to get resource means semaphore value is decrementing.