Re: Fixing Posix semaphores

2004-12-22 Thread Kamal R. Prasad

--- Peter Pentchev <[EMAIL PROTECTED]> wrote:

> On Wed, Dec 22, 2004 at 12:01:51AM +, 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[EMAIL PROTECTED][EMAIL PROTECTED]   
> [EMAIL PROTECTED]
> 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 
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Fixing Posix semaphores

2004-12-21 Thread Peter Pentchev
On Wed, Dec 22, 2004 at 12:01:51AM +, 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...
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 :(

G'luck,
Peter

-- 
Peter Pentchev  [EMAIL PROTECTED][EMAIL PROTECTED][EMAIL PROTECTED]
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?


pgpfL4ncCtqIl.pgp
Description: PGP signature


Re: Fixing Posix semaphores

2004-12-21 Thread Robert Watson

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.

Robert N M Watson FreeBSD Core Team, TrustedBSD Projects
[EMAIL PROTECTED]  Principal Research Scientist, McAfee Research


___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Fixing Posix semaphores

2004-12-13 Thread Joe Kelsey
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?

I currently run 5.3, but I suppose I could think about running current
at some point in the future.

/Joe


___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "[EMAIL PROTECTED]"