SYSV message queues
Chris Smith
chris at nfluid.co.uk
Tue Apr 13 04:54:07 PDT 2004
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: chris at nfluid.co.uk W: http://www.nfluid.co.uk
More information about the freebsd-hackers
mailing list