上传者: cindy_hlj
|
上传时间: 2021-12-24 22:39:28
|
文件大小: 245KB
|
文件类型: -
操作系统原理复习资料,供考试考研用
请给出记录型信号量中对P、V操作的定义。
答:
P(S) {
value--;
if (value < 0) {
add this process to list
block
}
}
V(S) {
value++;
if (value <= 0) {
remove a process P from list
wakeup(P);
}
}