From owner-freebsd-current Wed Jan 17 8:15:38 2001 Delivered-To: freebsd-current@freebsd.org Received: from khavrinen.lcs.mit.edu (khavrinen.lcs.mit.edu [18.24.4.193]) by hub.freebsd.org (Postfix) with ESMTP id 1598837B69D for ; Wed, 17 Jan 2001 08:15:18 -0800 (PST) Received: (from wollman@localhost) by khavrinen.lcs.mit.edu (8.9.3/8.9.3) id LAA18224; Wed, 17 Jan 2001 11:14:49 -0500 (EST) (envelope-from wollman) Date: Wed, 17 Jan 2001 11:14:49 -0500 (EST) From: Garrett Wollman Message-Id: <200101171614.LAA18224@khavrinen.lcs.mit.edu> To: Alfred Perlstein Cc: current@FreeBSD.ORG Subject: Re: Atomic breakage? In-Reply-To: <20010116191009.E7240@fw.wintelcom.net> References: <3A64AA23.30035A1C@elischer.org> <20010116191009.E7240@fw.wintelcom.net> Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG < said: > Just wondering, can't you use 'LOCK addl' and then use 'LOCK addc'? > add longword, add longword with carry? I know it would be pretty > ugly, but it should work, no? The two bus cycles are independent, so there is a race condition. OTOH, it's a fairly *unlikely* race condition, and the worst thing that can happen is statistics that are obviously off by four billion. (The race only occurs when there is a carry out of the low-order longword, which is to say, once in every 2**32 operations.) -GAWollman To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message