From owner-freebsd-hackers@FreeBSD.ORG Tue Apr 13 04:54:07 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 13ECF16A53C for ; Tue, 13 Apr 2004 04:54:07 -0700 (PDT) Received: from mail.nfluid.com (ors.orctel.co.uk [194.75.36.222]) by mx1.FreeBSD.org (Postfix) with ESMTP id A200D43D31 for ; Tue, 13 Apr 2004 04:54:06 -0700 (PDT) (envelope-from chris@nfluid.com) Received: from chris by mail.nfluid.com with local (Exim 4.30) id 1BDMWb-0002qE-B8; Tue, 13 Apr 2004 12:56:21 +0100 Content-Type: text/plain; charset="iso-8859-1" From: Chris Smith Organization: netFluid Technology Ltd To: freebsd-hackers@freebsd.org Date: Tue, 13 Apr 2004 12:56:21 +0100 User-Agent: KMail/1.4.3 References: <20040412011216.P7661@qvnfcne.eqfarg.eb> <407A3076.8030005@netli.com> <20040412114211.P35430@qvnfcne.eqfarg.eb> In-Reply-To: <20040412114211.P35430@qvnfcne.eqfarg.eb> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200404131256.21319.chris@nfluid.co.uk> Sender: Chris Smith cc: dudu@diaspar.rdsnet.ro Subject: Re: SYSV message queues X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: chris@nfluid.co.uk List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Apr 2004 11:54:07 -0000 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