From owner-freebsd-hackers Thu Jul 26 15: 8:19 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from sharmas.dhs.org (cpe-66-1-147-119.ca.sprintbbd.net [66.1.147.119]) by hub.freebsd.org (Postfix) with ESMTP id 4284E37B401; Thu, 26 Jul 2001 15:08:17 -0700 (PDT) (envelope-from adsharma@sharmas.dhs.org) Received: by sharmas.dhs.org (Postfix, from userid 500) id BDC215DD97; Thu, 26 Jul 2001 15:08:36 -0700 (PDT) Date: Thu, 26 Jul 2001 15:08:36 -0700 From: Arun Sharma To: John Baldwin Cc: hackers@FreeBSD.org Subject: Re: Need a clean room implementation of this function Message-ID: <20010726150836.C23264@sharmas.dhs.org> References: <20010726135913.A23052@sharmas.dhs.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.15i In-Reply-To: ; from jhb@FreeBSD.org on Thu, Jul 26, 2001 at 02:43:24PM -0700 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Thu, Jul 26, 2001 at 02:43:24PM -0700, John Baldwin wrote: > { > int val; > > do { > val = *(int *)addr; > } while (atomic_cmpset_int(addr, val, val | (1 << nr) == 0); > return (val & (1 << nr)); > } Thanks! I think that'd work. But code using BTS would be more efficient (fewer cycles). Many people asked me this question: the code I'm porting is: http://www.intel.com/research/mrl/orp/ Please see my messages to java@freebsd.org about the port. -Arun To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message