next up previous
Next: O Par Produtor-Consumidor: Buffer Up: Regiões Críticas Previous: Regiões Críticas

O Par Produtor-Consumidor: Processos


centering872

 
void Produce(void) tex2html_wrap_inline710

char c;

while (true) do tex2html_wrap_inline710

... /* produz o caracter c */

while(!Put(c));

/* insiste ate conseguir colocar no buffer*/

tex2html_wrap_inline714

tex2html_wrap_inline714

void Consume(void) tex2html_wrap_inline710

char c;

while (true) do tex2html_wrap_inline710

while(!Get(&c)); /* insiste ... */

... /* consome o caracter c */

tex2html_wrap_inline714

tex2html_wrap_inline714

void main(void) tex2html_wrap_inline710

cobegin

Produce(); tex2html_wrap_inline702 Consume();

coend

tex2html_wrap_inline714



Osvaldo Sergio F. de Carvalho
Wed Mar 19 14:56:39 EST 1997