进程 P 1和 P2 均包含并发执行的线程,部分伪代码描述如下所示。 // 进程 P 1 int x=0 ; Thread 1() { int a ; a=1 ; x+=1 ; } T h read2 () { i nt a ; a=2 ; x+=2 ; } // 进程 P2 int x=0 ; Thread3 () { int a ; a= x; x+=1 ; } T h read 4() { int b;b = x; x+=4 ; } 下列选项中,需要互斥执行的操作是( )。
A.
a=1 与 a=2
B.
a=x与 b=x
C.
x+=1 与 x+=2
D.
x=1与 x+=3
手机使用
分享
复制链接
新浪微博
分享QQ
微信扫一扫
微信内点击右上角“…”即可分享
反馈
参考答案:
举一反三
【单选题】听力原文:(A) The man is holding a microphone. (B) The man is speaking on stage. (C) The man is talking into the radio. (D) The man is installing a telephone.
【单选题】听力原文:(A) The man is doing maintenance outside. (B) The man is writing a letter. (C) The man is climbing the ladder. (D) The office is closed for today.
【单选题】听力原文:(A) The man is looking for the golf ball on the ground. (B) The man is hitting the ball. (C) The man bursts out of laughter. (D) The man is looking into the distance.
【单选题】听力原文:(A) The man is dialing a number on the phone. (B) The man is talking to the phone while walking. (C) The man uses his mobile phone in the office. (D) The man is looking forward.