From owner-freebsd-arch@FreeBSD.ORG Fri May 21 18:53:28 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 D4AC416A4CE; Fri, 21 May 2004 18:53:28 -0700 (PDT) Received: from rwcrmhc12.comcast.net (rwcrmhc12.comcast.net [216.148.227.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7E3B943D39; Fri, 21 May 2004 18:53:28 -0700 (PDT) (envelope-from julian@elischer.org) Received: from interjet.elischer.org ([24.7.73.28]) by comcast.net (rwcrmhc12) with ESMTP id <2004052201531401400g304le>; Sat, 22 May 2004 01:53:14 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id SAA91906; Fri, 21 May 2004 18:53:13 -0700 (PDT) Date: Fri, 21 May 2004 18:53:11 -0700 (PDT) From: Julian Elischer To: Garance A Drosihn In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: arch@freebsd.org cc: mtm@freebsd.org Subject: Re: atomic reference counting primatives. 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: Sat, 22 May 2004 01:53:28 -0000 On Fri, 21 May 2004, Garance A Drosihn wrote: > At 1:56 PM -0700 5/20/04, Julian Elischer wrote: > >This has been raised before but I have come across uses for > >it again and again so I'm raising it again. JHB once posted > >some atomic reference counting primitives. (Do you still have > >them John?) Alfred once said he had some somewhere too, and > >others have commented on this before, but we still don't seem > >to have any. > > Btw, does this thread have anything to do with the present > buuldworld-breakage for sparc64? Not specifically, but for the reasons you outline below, it's an example of the kind of reason one might have for doing it.. > I notice the compile-time > errors are something like: > > /usr/src/lib/libthr/thread/thr_cancel.c: In function `testcancel': > /usr/src/lib/libthr/thread/thr_cancel.c:123: warning: passing > arg 1 of `atomic_cmpset_int' from incompatible pointer type > > My guess is that this is related to Mike's change to "Make libthr > async-signal-safe without costly signal masking. [...etc...]". > > This breakage underlines one reason that it would be mighty > convenient to have some "official" set of primitives. It is > one thing if a developer has to roll-their-own solution for > i386, but somewhat more challenging if that solution has to > work across a half-dozen different hardware platforms. > > This also suggests that it would be nice if the primitives > could be written so that if the wrong type-of-parameters are > given, the compiles will fail on *all* platforms. > > -- > Garance Alistair Drosehn = gad@gilead.netel.rpi.edu > Senior Systems Programmer or gad@freebsd.org > Rensselaer Polytechnic Institute or drosih@rpi.edu >