Date: Tue, 13 Apr 2004 12:56:21 +0100 From: Chris Smith <chris@nfluid.co.uk> To: freebsd-hackers@freebsd.org Cc: dudu@diaspar.rdsnet.ro Subject: Re: SYSV message queues Message-ID: <200404131256.21319.chris@nfluid.co.uk> In-Reply-To: <20040412114211.P35430@qvnfcne.eqfarg.eb> References: <20040412011216.P7661@qvnfcne.eqfarg.eb> <407A3076.8030005@netli.com> <20040412114211.P35430@qvnfcne.eqfarg.eb>
next in thread | previous in thread | raw e-mail | index | archive | help
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(= ). > > =09It 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=20 messages out of the queue out of FIFO order. Priorities etc, or when you= 've=20 got multiple processes reading a single queue and want to send a particul= ar=20 process a message. SYSV queues are just the ticket for this..... Be carefull with SYSV Message Queues though as the default settings of qu= eue=20 size etc are broken in freeBSD/netBSD/openBSD (see my earlier email=20 http://lists.FreeBSD.org/pipermail/freebsd-hackers/2004-March/006011.html= ) Incidentally, what is the resolution of this?? Cheers,=20 Chris --=20 Chris Smith Technical Architect - netFluid Technology Ltd. "Internet Technologies, Distributed Systems and Tuxedo Consultancy" E: chris@nfluid.co.uk W: http://www.nfluid.co.uk
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200404131256.21319.chris>