Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 6 Apr 1999 18:36:40 -0300 (EST)
From:      Aldrin L <aldrin@americasnet.com>
To:        "Brian O'Shea" <boshea@ricochet.net>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: Semaphores
Message-ID:  <Pine.BSF.4.05.9904061829060.284-100000@athome.logicStudios.org>
In-Reply-To: <19990406113121.J2844@localdomain>

next in thread | previous in thread | raw e-mail | index | archive | help
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"?

	What about named pipes? Do i have then available under FreeBSD?    

> If you just need simple binary semaphores to synchronize threads in a
> user-threaded process then pthread mutexes may suit your needs.  To use
> them, include <pthread.h> and link against the libc_r library instead
> of libc (either with the -lc_r linker option or with the -pthread
> compiler option, which is FreeBSD-specific).  See the man page on
> pthread(3) for an overview of the pthread library functions.

	This will be considered on a later stage. I just don't want
to write the network/daemon handling code now. But later, pthreads sounds
like a good idea. :]

> 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. :] 

	Anyway, thanks for your reply. :]

	done, Aldrin Leal <aldrin@americasnet.com>



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?Pine.BSF.4.05.9904061829060.284-100000>