From owner-freebsd-arch@FreeBSD.ORG Wed Dec 22 01:15:12 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E89C316A4D1 for ; Wed, 22 Dec 2004 01:15:11 +0000 (GMT) Received: from gandalf.online.bg (gandalf.online.bg [217.75.128.9]) by mx1.FreeBSD.org (Postfix) with SMTP id EB62443D58 for ; Wed, 22 Dec 2004 01:15:09 +0000 (GMT) (envelope-from roam@ringlet.net) Received: (qmail 2655 invoked from network); 22 Dec 2004 01:15:07 -0000 Received: from unknown (HELO straylight.ringlet.net) (213.16.36.118) by gandalf.online.bg with SMTP; 22 Dec 2004 01:15:07 -0000 Received: (qmail 70899 invoked by uid 1000); 22 Dec 2004 01:15:07 -0000 Date: Wed, 22 Dec 2004 03:15:06 +0200 From: Peter Pentchev To: Robert Watson Message-ID: <20041222011506.GG801@straylight.m.ringlet.net> Mail-Followup-To: Robert Watson , Joe Kelsey , arch@freebsd.org, stable@freebsd.org, hackers@freebsd.org, current@freebsd.org References: <1102975803.30309.196.camel@zircon.zircon.seattle.wa.us> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="0qt3EE9wi45a2ZFX" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.6i 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-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Dec 2004 01:15:12 -0000 --0qt3EE9wi45a2ZFX Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Dec 22, 2004 at 12:01:51AM +0000, Robert Watson wrote: >=20 > On Mon, 13 Dec 2004, Joe Kelsey wrote: >=20 > > 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.=20 > > 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.=20 > >=20 > > 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?=20 >=20 > >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.=20 >=20 > 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 --=20 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? --0qt3EE9wi45a2ZFX Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (FreeBSD) iD8DBQFByMqa7Ri2jRYZRVMRAlEPAKDDChgctYLb3u/wxshef1C9gj03kQCfeKv6 fvXZ6UOrvkG0sLS343Rmau0= =Hn9M -----END PGP SIGNATURE----- --0qt3EE9wi45a2ZFX--