From owner-freebsd-smp@FreeBSD.ORG Fri Apr 4 11:54:10 2003 Return-Path: Delivered-To: freebsd-smp@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1C0ED37B408; Fri, 4 Apr 2003 11:54:10 -0800 (PST) Received: from phoenix.infradead.org (phoenix.infradead.org [195.224.96.167]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9C63443FA3; Fri, 4 Apr 2003 11:54:07 -0800 (PST) (envelope-from hch@infradead.org) Received: from hch by phoenix.infradead.org with local (Exim 4.10) id 191XGH-0007jL-00; Fri, 04 Apr 2003 20:54:05 +0100 Date: Fri, 4 Apr 2003 20:54:05 +0100 From: Christoph Hellwig To: Garrett Rooney Message-ID: <20030404205405.A29698@infradead.org> References: <3E8DE275.6040000@electricjellyfish.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <3E8DE275.6040000@electricjellyfish.net>; from rooneg@electricjellyfish.net on Fri, Apr 04, 2003 at 02:52:21PM -0500 cc: freebsd-smp@FreeBSD.org cc: John Baldwin Subject: Re: atomic_dec_and_test() in FreeBSD? X-BeenThere: freebsd-smp@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: FreeBSD SMP implementation group List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Apr 2003 19:54:10 -0000 On Fri, Apr 04, 2003 at 02:52:21PM -0500, Garrett Rooney wrote: > yeah, the default implementation of this function in APR uses mutexes to > ensure that the increment is atomic, but craig is looking for a way to > implement the 'platform specific faster way to do it without a mutex'. > worst case, we can just use the default impl on freebsd 4.x and use > atomic_cmpset_int on 5.x. Just FYI, the i386 atomic.h from Linux doesn't rely on any kernel features so you could in theory just copy it over. But I guess the licensing stand against this.