单选题:The following code fragment for the wait() semaphore operation i
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
@[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