Re: Fixing Posix semaphores

From: Kamal R. Prasad <kamalpr_at_yahoo.com>
Date: Wed, 22 Dec 2004 08:06:56 -0800 (PST)
--- Peter Pentchev <roam_at_ringlet.net> wrote:

> On Wed, Dec 22, 2004 at 12:01:51AM +0000, Robert
> Watson wrote:
> > 
> > On Mon, 13 Dec 2004, Joe Kelsey wrote:
> > 
> > > I have a desire to fix posix semaphores in at
> least 5.3.  The current
> > > implementation doesn't actually follow the
> "spirit" of the standard,
> > > even though it technically qualifies in a
> somewhat degraded sense.  I
> > > refer to the fact that the current
> implementation treats posix
> > > semaphores as completely contained inside the
> kernel and essentially
> > > divorced from the filesystem.  The true "spirit"
> of the standard places
> > > the semaphores directly in the file system,
> similar to named pipes. 
> > > However the current implementation treats the
> supplied "name" as a
> > > 14-character identifier, required to begin with
> a slash and contain no
> > > other slashes.  Pretty weak. 
> > > 
> > > Well, in order to fix this, we need to add file
> system code and come up
> > > with a new type.  I currently have some time to
> spend on something like
> > > this and am willing to put in whatever effort it
> takes.  Does anyone
> > > want to add their own ideas or requirements? 
> > 
> > >From my perspective, the biggest win here is that
> it would permit
> > different name spaces to trivially exist using
> multiple mountpoints of a
> > "semfs".  This would make it easy to allow
> applications in different jails
> > to use identical names without colliding. 
> > 
> > FWIW, my only experience with POSIX semaphores on
> a system other than
> > FreeBSD is on Darwin, where a similar model is
> used to that on FreeBSD: a
> > flat kernel-maintained name space is present.
> 
> I seem to remember either W. Richard Stevens's APUE,
> or Marc Rochkind's
> AUP stating that:
> 
> 1. the standards say that semaphore names ought to
> have filesystem
>    semantics, but...
> 2. the standards leave it to the implementation to
> define whether
>    slashes should be allowed at all except in the
> first position, so...

But the Posix 1003.1 does require that afully
qualified pathname be supported by the interface.

> 3. portable programs should only depend on a flat
> namespace,
>    especially as...
> 4. there are widely-used OS's (ISTR Solaris, but
> ICBW) that only provide
>    a flat namespace.
> 
> Thus, it would seem that even if somebody would do
> the work to really
> tie the semaphore naming fully to the filesystem,
> still programs that
> want to be Really Really Portable would not dare use
> this feature,
> wonderful as it would be for those that do :(
> 
Well -the issue was about providing support to the
interface so that it can handle a fully qualified
pathname. If a programmer wants to use a flat
namespace to ensure that his program is portable onto
other OS'es that don't adhere to the std -that is a
different issue [which does not put it in conflict
with the std]. BTW -I see no reason why pathnames
should be tied to the filesystem, instead of being
used simply as identifiers across processes. 

regards
-kamal

> G'luck,
> Peter
> 
> -- 
> Peter Pentchev	roam_at_ringlet.net    roam_at_cnsys.bg   
> roam_at_FreeBSD.org
> PGP key:
> http://people.FreeBSD.org/~roam/roam.key.asc
> Key fingerprint	FDBA FD79 C26F 3C51 C95E  DF9E ED18
> B68D 1619 4553
> What would this sentence be like if pi were 3?
> 

> ATTACHMENT part 2 application/pgp-signature 




		
__________________________________ 
Do you Yahoo!? 
Take Yahoo! Mail with you! Get it on your mobile phone. 
http://mobile.yahoo.com/maildemo 
Received on Wed Dec 22 2004 - 15:06:58 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:25 UTC