From owner-freebsd-questions Tue Apr 6 16:42:41 1999 Delivered-To: freebsd-questions@freebsd.org Received: from allegro.lemis.com (allegro.lemis.com [192.109.197.134]) by hub.freebsd.org (Postfix) with ESMTP id B229D15453 for ; Tue, 6 Apr 1999 16:42:18 -0700 (PDT) (envelope-from grog@freebie.lemis.com) Received: from freebie.lemis.com (freebie.lemis.com [192.109.197.137]) by allegro.lemis.com (8.9.1/8.9.0) with ESMTP id JAA11118; Wed, 7 Apr 1999 09:10:14 +0930 (CST) Received: (from grog@localhost) by freebie.lemis.com (8.9.3/8.9.0) id JAA12808; Wed, 7 Apr 1999 09:10:13 +0930 (CST) Message-ID: <19990407091013.P2142@lemis.com> Date: Wed, 7 Apr 1999 09:10:13 +0930 From: Greg Lehey To: Aldrin L , "Brian O'Shea" 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.2i In-Reply-To: ; from Aldrin L on Tue, Apr 06, 1999 at 06:36:40PM -0300 WWW-Home-Page: http://www.lemis.com/~grog Organization: LEMIS, PO Box 460, Echunga SA 5153, Australia Phone: +61-8-8388-8286 Fax: +61-8-8388-8725 Mobile: +61-41-739-7062 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Tuesday, 6 April 1999 at 18:36:40 -0300, Aldrin L wrote: > On Tue, 6 Apr 1999, Brian O'Shea wrote: > >> There are a few options depending on what you need semaphores for. >> If you need process-shared semaphores (ones that can be used to >> synchronize multiple processes, as opposed to just threads in the same >> process), then you will need to use the SysV semaphore interface (so >> you will need to compile a knernel with support for them). > > 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"? Why not use file locking? That's what it's for. >> 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. It sounds like your laziness could get you into a whole lot more work. You just have to make sure these options are in your config file. It's not much: # These three options provide support for System V Interface # Definition-style interprocess communication, in the form of shared # memory, semaphores, and message queues, respectively. # options SYSVSHM options SYSVSEM options SYSVMSG Greg -- When replying to this message, please copy the original recipients. For more information, see http://www.lemis.com/questions.html See complete headers for address, home page and phone numbers finger grog@lemis.com for PGP public key To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message