process serversi(i=
begin
repeat
p(customer_count);
p(mutex);
從隊列中取下一個號碼
v(mutex);
為該號碼持有者服務
end
coend
思考
某車站售票廳
(
(
定義信號量S
The P
var S:semaphore;
S=
cobegin
procedure P_i:
begin
p(s);
·
Enter and buy ticket;
·
v(s)
end
coend
最大值為
[
From:http://tw.wingwit.com/Article/program/czxt/201311/24274.html