On Monday 12 Apr 2004 09:55, Vlad GALU wrote: > > Did you try to grok what the msgrcv() call is supposed to return? > > Specifically, read about -1/EAGAIN and IPC_NOWAIT. Then remove sleep(). > > It is supposed to block, waiting for more events to be inserted > into the queue.
Yes but sometimes it can't and will return an EAGAIN. You *MUST* trap this and try the msgrcv again. > > > However, does anyone have a better design ? > > > > Yes. Use sockets. Sockets (streams etc) work excellently _unless_ you periodically need to pick messages out of the queue out of FIFO order. Priorities etc, or when you've got multiple processes reading a single queue and want to send a particular process a message. SYSV queues are just the ticket for this..... Be carefull with SYSV Message Queues though as the default settings of queue size etc are broken in freeBSD/netBSD/openBSD (see my earlier email http://lists.FreeBSD.org/pipermail/freebsd-hackers/2004-March/006011.html ) Incidentally, what is the resolution of this?? Cheers, Chris -- Chris Smith Technical Architect - netFluid Technology Ltd. "Internet Technologies, Distributed Systems and Tuxedo Consultancy" E: [EMAIL PROTECTED] W: http://www.nfluid.co.uk _______________________________________________ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "[EMAIL PROTECTED]"