From owner-freebsd-arch Wed Mar 27 14: 3:29 2002 Delivered-To: freebsd-arch@freebsd.org Received: from k6.locore.ca (k6.locore.ca [198.96.117.170]) by hub.freebsd.org (Postfix) with ESMTP id E6E4037B42A; Wed, 27 Mar 2002 14:03:16 -0800 (PST) Received: (from jake@localhost) by k6.locore.ca (8.11.6/8.11.6) id g2RMDqo35691; Wed, 27 Mar 2002 17:13:52 -0500 (EST) (envelope-from jake) Date: Wed, 27 Mar 2002 17:13:51 -0500 From: Jake Burkholder To: John Baldwin Cc: Julian Elischer , arch@FreeBSD.ORG Subject: Re: SMP safe reference counting Message-ID: <20020327171351.E31836@locore.ca> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from jhb@FreeBSD.ORG on Wed, Mar 27, 2002 at 04:51:57PM -0500 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 Apparently, On Wed, Mar 27, 2002 at 04:51:57PM -0500, John Baldwin said words to the effect of; > > 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. We support 386 still? > > -- > > 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 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message