问题
单项选择题
读者写者问题的解决方案如下所示。 Begin ① ; read_count:=read_count+1; if read_count=1 then P(write); ② ; 读文件; ③ ; read_count:=read_count-1; if read_count=0 then V(write); ④ ; End; 假设信号量mutex表示对read_count共享变量所关注的互斥区进行互斥,那以,①、②、③和④处应该填写的语句是
A.P(mute、P(mute、V(mute、V(mute
B.P(mute、V(mute、P(mute、V(mute
C.V(mute、V(mute、P(mute、P(mute
D.V(mute、P(mute、V(mute、P(mute
答案
参考答案:B