Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 Sep 2002 18:09:39 -0700
From:      Alfred Perlstein <bright@mu.org>
To:        Daniel Eischen <eischen@pcnet1.pcnet.com>
Cc:        hackers@FreeBSD.ORG
Subject:   Re: sem_* API
Message-ID:  <20020917010939.GE86737@elvis.mu.org>
In-Reply-To: <Pine.GSO.4.10.10209161929080.11138-100000@pcnet1.pcnet.com>
References:  <20020916231141.GB86737@elvis.mu.org> <Pine.GSO.4.10.10209161929080.11138-100000@pcnet1.pcnet.com>

next in thread | previous in thread | raw e-mail | index | archive | help
* Daniel Eischen <eischen@pcnet1.pcnet.com> [020916 16:41] wrote:
> On Mon, 16 Sep 2002, Alfred Perlstein wrote:
> 
> > * Alfred Perlstein <bright@mu.org> [020916 16:08] wrote:
> > > I got sort of bored so I wrote a kernel version of the POSIX sem_*
> > > functions so that we can support sem_open() and sem_init() when 'pshared'
> > > is set to true.  Basically this is posix semaphores that can be used
> > > between processes.
> > > 
> > > I haven't tested it as of yet (but I will be soon), here's the delta
> > > for it.
> > > 
> > > Does anyone know a test suite for this API?
> > 
> > Of course actually including the _new_ files might help,
> > the diff can be pulled from here:
> > 
> > http://people.freebsd.org/~alfred/deltas/sem.diff.gz
> 
> I'll only comment on the pthread portion.
> 
> Please put objects in the beginning of the file before functions
> are implemented (named_sems and named_sems_mtx are declared
> between functions) to keep in style with the rest of the thread
> code.
> 
> If those objects (named_sems and named_sems_mtx) need to be external
> then you must precede them with underscores.  I think they can be
> static though.
> 
> If you use mutexes internally (that the application doesn't know
> about) then you must use the _pthread_mutex_* variants (single
> underscore).  The library treats these differently so that the
> thread will not be canceled or have a signal handler installed
> while holding one of these.

Thank you, I've applied all your suggested changes to my local
tree.  Yes, the structures are local, I neglected to 'staticize'
them.

I've also applied the delta to libc_r since Julian said I would
need to do that to test it for now.

Does it make sense for these to actually be in libc?  This is
because they can be used to inter-process syncronization, not
just between threads...

-- 
-Alfred Perlstein [alfred@freebsd.org]
'Instead of asking why a piece of software is using "1970s technology,"
 start asking why software is ignoring 30 years of accumulated wisdom.'

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020917010939.GE86737>