From owner-freebsd-arch Wed Mar 27 13:52:24 2002 Delivered-To: freebsd-arch@freebsd.org Received: from mail16.speakeasy.net (mail16.speakeasy.net [216.254.0.216]) by hub.freebsd.org (Postfix) with ESMTP id 97FA537B419 for ; Wed, 27 Mar 2002 13:51:55 -0800 (PST) Received: (qmail 22095 invoked from network); 27 Mar 2002 21:51:55 -0000 Received: from unknown (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) by mail16.speakeasy.net (qmail-ldap-1.03) with DES-CBC3-SHA encrypted SMTP for ; 27 Mar 2002 21:51:55 -0000 Received: from laptop.baldwin.cx (gw1.twc.weather.com [216.133.140.1]) by server.baldwin.cx (8.11.6/8.11.6) with ESMTP id g2RLqav92810; Wed, 27 Mar 2002 16:52:36 -0500 (EST) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.5.2 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: Date: Wed, 27 Mar 2002 16:51:57 -0500 (EST) From: John Baldwin To: Julian Elischer Subject: RE: SMP safe reference counting Cc: arch@freebsd.org Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 27-Mar-2002 Julian Elischer wrote: > > [please remove -smp from your reply] > > Once again on the SMP list a lock is being used to make a reference count > safe. I'd like to re-raise the issue of a safe reference counting > fascility. > > what would be the semantics? I have refcount.patch :) What would be nice is to first implement atomic_fetchadd() (xadd on 486+, some hack on 386, fetchadd on ia64, similar to atomic_add on sparc64, alpha, and powerpc I believe, basically it would add a value to a memory location and return the result). You can then use taht for the reference_release (or whatever you call it). We could also use that to get rid of the really bloated debug version that uses a mutex and have a much smaller debug version that still uses atomic ops. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message