八 真經之管道通信問題(西北工大
在管道通信機制中
問題分析
UNIX系統中
The P
begin
pipe:array[
ts=
empty
cobegin
process PipeWriter
begin
repeat;
產生數據
p(empty);
length=data length;
while(length>
begin
pipe[in]=data of
in=(in+
ts=ts
length=length
end
v(full);
end
process Consumer
begin
repeat;
p(full);
從緩沖區取出一件物品;
out=(out+
ts=ts+
v(empty);
end
coend
end
返回《操作系統之PV金典》
From:http://tw.wingwit.com/Article/program/czxt/201311/24254.html