安徽理工大学2014操作系统试卷答案(2)
发布时间:2021-06-07
发布时间:2021-06-07
安徽理工大学2014操作系统B卷答案,及试题(上张)
signal(S);
perform read operation; wait(rmutex); readcount=readcount-1; if readcount==0 then signal(wmutex); signal(rmutex); until false; end; writer:begin repeat wait(mutex); if writecount==0
2.
then wait(S);
writecount=writecount+1; signal(mutex); wait(wmutex);
perform write operation; signal(wmutex); wait(mutex);
writecount=writecount-1; if writecount==0 then signal(S); signal(mutex); until false; end;
得出安全序列为P4->P2->P3->P5->P1
下一篇:红头文件的制作及标准