問題詳情

19)读者写者问题的解决方案如下所示。Begin----①----;read_count:=read_count+1;if read_count=1then Pwrite);----②----;读文件;----③----;read_count:=read_count -1;if read_count=0then Vwrite);----④----;End.假设信号量 mutex 表示对 read_count 共享变量所关注的互斥区进行互斥,那么,①、②、③和④处应该填写的语句是。
(A)Pmutex)、Pmutex)、Vmutex)、Vmutex)
(B)Pmutex)、Vmutex)、Pmutex)、Vmutex)
(C)Vmutex)、Vmutex)、Pmutex)、Pmutex)
(D)Vmutex)、Pmutex)、Vmutex)、Pmutex)

參考答案

答案:B
難度:適中0.5
統計:A(0),B(0),C(0),D(0),E(0)

內容推薦

內容推薦