home *** CD-ROM | disk | FTP | other *** search
- /***************************************************************************
- * *
- * @@@@ @@@ @@@@@ @@@@@ @@@@@ @@@ @@@@ @ @ @@@@@ @@@@@ @@@@ @@@ *
- * @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ *
- * @ @ @ @@@@@ @ @@@@@ @ @@@@@ @ @ @ @@@@@ @ @ @ *
- * @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ *
- * @@@@ @@@ @@@@@ @ @ @ @@@ @@@@ @@@@@ @ @@@@@ @@@@ @@@ *
- * *
- * A compiler for distributed programming with C *
- * *
- * c o n s u m e r . d c *
- * *
- * Version 1.0 CreationDate: 17.07.91 *
- * LastUpDate: 17.07.91 *
- * *
- * Process building a consumer for the producer/consumer example. *
- * *
- * Copyright (C) 1990,1991 by Christoph Pleier. *
- * All rights reserved! *
- ***************************************************************************/
-
- #include "config.h"
-
- /* definition of the process 'consumer' */
- process body consumer(num, buffer_descr)
- {
- struct msg_t msg;
-
- /* receive continuously messages from buffer and terminate if
- * the transaction can not be performed within 3 minutes!
- */
- while(1) {
- msg = within 180 ? (buffer_descr@b_read() : (exit(0), msg));
- printf("consumer %d: message from %s: value = %d\n",
- num, msg.name, msg.value);
- fflush(stdout);
- }
- } /* process body consumer */
-