Var mutex:semaphore∶=
begin
parbegin
process
repeat
wait(mutex);
critical section
signal(mutex);
remainder seetion
until false;
end
process
repeat
wait(mutex);
critical section
signal(mutex);
remainder section
until false;
end
parend
Var a
begin
parbegin
begin S
begin wait(a); S
begin wait(b); S
begin wait(c); S
begin wait(d); S
begin wait(e); wait(f); wait(g); S
parend
end
——返回教材目錄
了解更多計算機相關基礎課程視頻
[
From:http://tw.wingwit.com/Article/program/czxt/201311/24207.html