-->
当前位置:首页 > 题库

单选题:The following code fragment for the wait() semaphore operation i

Luz5年前 (2021-05-10)题库809
The following code fragment for the wait() semaphore operation is from the textbook:
@[B](1)
```
wait(S) :
S.value--;
if (S.value < 0) {
add this process to S.L;
block;
}
```
What is it assuming?
A. This is not a multiprocessor environment
B. This code is executed atomically
C. Test−and−Set is properly implemented
D. S.value is initially 1




A.This is not a multiprocessor environment
B.This code is executed atomically
C.Test−and−Set is properly implemented
D.S.value is initially 1


答案:B