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

单选题:Suppose that a shared variable total (initialized as 0 ) can be

Luz5年前 (2021-05-10)题库883
Suppose that a shared variable total (initialized as 0 ) can be accessed by the process P0 and P1. If the following processes execute concurrently, what is the probable minimum result of total? @[B](1)
```
P1:
{
int count;
for ( count =1; count <= 50; count++ )
total = total + 1;
}
P2:
{
int count;
for ( count =1; count <= 50; count++ )
total = total + 1;
}

```
A. 1
B. 2
C. 3
D. 50



A.1
B.2
C.3
D.50


答案:B