156
The bounded-buffer P/C problem with
message passing
Producer:
var pmsg: message;
repeat
receive(mayproduce, pmsg);
pmsg:= produce();
send(mayconsume, pmsg);
forever
Consumer:
var cmsg: message;
repeat
receive(mayconsume, cmsg);
consume(cmsg);
send(mayproduce, null);
forever