Date: Tue, 6 Apr 1999 15:56:09 -0700 From: "Brian O'Shea" <boshea@ricochet.net> To: Aldrin L <aldrin@americasnet.com> Cc: freebsd-questions@freebsd.org Subject: Re: Semaphores Message-ID: <19990406155609.L2844@localdomain> In-Reply-To: <Pine.BSF.4.05.9904061829060.284-100000@athome.logicStudios.org>; from Aldrin L on Tue, Apr 06, 1999 at 06:36:40PM -0300 References: <19990406113121.J2844@localdomain> <Pine.BSF.4.05.9904061829060.284-100000@athome.logicStudios.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19990406155609.L2844>