在信号量的上下文中 P 和 V 操作的原始含义是什么? [英] What is the original meaning of P and V operations in a context of a semaphore?

查看:67
本文介绍了在信号量的上下文中 P 和 V 操作的原始含义是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有谁知道为什么信号量操作被称为P和V?每次我读一章关于信号量的内容时,它都会说如下:

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:

为了让线程获得资源,它执行了一个 P 操作.并且为了让线程释放资源,它执行了一个 V 操作.

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.

P 和 V 代表什么?为什么它们不被称为等待和信号?

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

推荐答案

Dijkstra,信号量的发明者之一,使用了 P 和 V.这些字母来自荷兰语单词 Probeer(尝试)和 Verhoog(增量).

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

另见:https://cs.nyu.edu/~yap/classes/os/resources/origin_of_PV.html

这篇关于在信号量的上下文中 P 和 V 操作的原始含义是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆