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

送分小仙女□ 提交于 2019-12-22 03:42:53

问题


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?


回答1:


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




回答2:


V stands for signal and P stands for wait.

You can check the wiki for details.

Why they are not called wait and signal?

I would agree with Bill on this, the most likely reason is that because there are a lot of people who dont use English, so its probably because of that it is not called wait and signal.



来源:https://stackoverflow.com/questions/29606162/what-is-the-original-meaning-of-p-and-v-operations-in-a-context-of-a-semaphore

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!