修改下面生产者——消费者总是的解法中的错误:
producer consumer
begin begin
repeat repeat
. p(mutex);
produce a new message m; p(empty);
p(mutex); m:=buffer(out);
p(full); out:=out+1;
buffer(in):=m; v(mutex);
v(mutex); consume message m;
until false until false
end end
p(mutex);
这道题你会答吗?花几分钟告诉大家答案吧!
扫描二维码,关注牛客网
下载牛客APP,随时随地刷题