From owner-freebsd-questions Fri Oct 25 6:22:34 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A4DF737B404 for ; Fri, 25 Oct 2002 06:22:32 -0700 (PDT) Received: from cactus.fi.uba.ar (cactus.fi.uba.ar [157.92.49.108]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6CF0A43E65 for ; Fri, 25 Oct 2002 06:22:31 -0700 (PDT) (envelope-from fgleiser@cactus.fi.uba.ar) Received: from cactus.fi.uba.ar (cactus.fi.uba.ar [157.92.49.108]) by cactus.fi.uba.ar (8.12.3/8.12.3) with ESMTP id g9PDKlxZ052426; Fri, 25 Oct 2002 10:20:47 -0300 (ART) (envelope-from fgleiser@cactus.fi.uba.ar) Date: Fri, 25 Oct 2002 10:20:47 -0300 (ART) From: Fernando Gleiser To: Jonathan Belson Cc: freebsd-questions@freebsd.org Subject: Re: [Q] Sockets verses message queues? In-Reply-To: <3DB922C2.30009@witchspace.com> Message-ID: <20021025101456.C11230-100000@cactus.fi.uba.ar> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Status: No, hits=-3.5 required=5.0 tests=IN_REP_TO,SUBJ_ENDS_IN_Q_MARK version=2.31 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Fri, 25 Oct 2002, Jonathan Belson wrote: > Hiya > > > I'm writing an application which will fork into two processes > (master/slave), and I require that the two be able to > communicate asynchronously. The master will send commands to > the slave then get on with other things, and the slave will > send a message back when it's finished. > > Is there any advantage to using AF_UNIX sockets rather than > message queues, or vice versa (I was thinking about speed, > but sockets seem to be more complicated code-wise)? I seem to recall that on BSD systems sockets are faster than message queues (SysV msg queues) but it depends on the undelying kernel implementation. Maybe sockets are faster on BSD but slower on solaris. Personally, I prefer sockets or pipes (both named and anonymous) to message queues but YMMV. Fer > > Cheers, > > > --Jon > > http://www.witchspace.com > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message