From owner-freebsd-hackers@FreeBSD.ORG Wed Dec 22 16:06:58 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E709F16A4CF for ; Wed, 22 Dec 2004 16:06:57 +0000 (GMT) Received: from web52709.mail.yahoo.com (web52709.mail.yahoo.com [206.190.39.160]) by mx1.FreeBSD.org (Postfix) with SMTP id D4DC843D49 for ; Wed, 22 Dec 2004 16:06:56 +0000 (GMT) (envelope-from kamalpr@yahoo.com) Received: (qmail 67112 invoked by uid 60001); 22 Dec 2004 16:06:56 -0000 Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; b=srtaJajv+uicKRfs4n8XT+PJxg62am5CfAgbFEONFOPbwkP8RZckd4hW3TaIaPuUt4EQ0WvyEdbgXgJ4Elq3uNcRYQ8l+GTpgYQs9bHbCaZVCICiSOK2j/1yB56dCiS0lzTEgDO2dBMjJUg/G8xAV66fZ7iOxOn2R7qTfJNoJM8= ; Message-ID: <20041222160656.67110.qmail@web52709.mail.yahoo.com> Received: from [203.195.199.244] by web52709.mail.yahoo.com via HTTP; Wed, 22 Dec 2004 08:06:56 PST Date: Wed, 22 Dec 2004 08:06:56 -0800 (PST) From: "Kamal R. Prasad" To: Peter Pentchev , Robert Watson In-Reply-To: <20041222011506.GG801@straylight.m.ringlet.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii cc: arch@freebsd.org cc: stable@freebsd.org cc: hackers@freebsd.org cc: Joe Kelsey cc: current@freebsd.org Subject: Re: Fixing Posix semaphores X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: kamalp@acm.org List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Dec 2004 16:06:58 -0000 --- Peter Pentchev 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@ringlet.net roam@cnsys.bg > roam@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