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