From owner-freebsd-questions Tue Apr 6 15:48:58 1999 Delivered-To: freebsd-questions@freebsd.org Received: from rgate2.ricochet.net (rgate2.ricochet.net [204.179.143.3]) by hub.freebsd.org (Postfix) with ESMTP id 82DE915620 for ; Tue, 6 Apr 1999 15:48:37 -0700 (PDT) (envelope-from boshea@ricochet.net) Received: from beastie.localdomain (mg128-016.ricochet.net [204.179.128.16]) by rgate2.ricochet.net (8.9.3/8.9.3) with ESMTP id RAA12612; Tue, 6 Apr 1999 17:46:35 -0500 (CDT) Received: (from brian@localhost) by beastie.localdomain (8.8.8/8.8.7) id PAA12843; Tue, 6 Apr 1999 15:56:10 -0700 (PDT) (envelope-from brian) Message-ID: <19990406155609.L2844@localdomain> Date: Tue, 6 Apr 1999 15:56:09 -0700 From: "Brian O'Shea" To: Aldrin L Cc: freebsd-questions@freebsd.org Subject: Re: Semaphores References: <19990406113121.J2844@localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.93.1i In-Reply-To: ; from Aldrin L on Tue, Apr 06, 1999 at 06:36:40PM -0300 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Tue, Apr 06, 1999 at 06:36:40PM -0300, Aldrin L wrote: > I was thinking about some sorta of serialization when writing to a > data file. My project is a SNPP (rfc1861) <-> TAP gateway for alphanumeric > paging devices. For simplicity and to faster devel., i chose to write is > as as an attached process to xinetd. The problem is that i need to write > batches of messages, and i think i have to care about its serialization. > Or not, if i do it atomically. Does FreeBSD supports the posixen "Atomic > Operations"? > > What about named pipes? Do i have then available under FreeBSD? Named pipes are supported; see the mkfifo(1) man page. It sounds like you might be able to get away with using advisory record locking with lockf(3), which is quite a bit simpler to use than System V semaphores. Also, file locks are not persistant so if your program crashes, any locks it holds are released automatically by the system. They are slightly slower than semaphores, though. I don't know about POSIX "Atomic Operations". Can't find a reference to them, so I'm guessing the answer is no. > > p.s. Is there any particular reason for why you don't want to recompile > > your kernel? > > The first: just to know which IPC options i had under freebsd; > Secondly: I'm a lazy person. Just want to avoid kernel compiles. > But i'll do it, it's just a matter of grabbing and reading the docs. :] > You shouldn't find it too difficult. I thought you were concerned about downtime or something. Cheers, -brian -- Brian O'Shea boshea@ricochet.net To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message