next up previous
Next: Producer Consumer with Flow Up: No Title Previous: Message Passing

Producer-Consumer (as message passing)

  figure53
Figure:

Process PRODUCER ;
 var msg : itemtype ;
 loop
   produce(msg) ;
   send(CONSUMER, msg);
 end ;

Process CONSUMER ;
 var amsg : itemtype ;
 loop 
   receive(PRODUCER, amsg) ;
   consumer(msg) ;
 end ;

  figure58
Figure:



Omer F Rana
Tue Feb 11 19:19:52 GMT 1997