From owner-freebsd-smp Fri Dec 8 22:21:54 2000 From owner-freebsd-smp@FreeBSD.ORG Fri Dec 8 22:21:52 2000 Return-Path: Delivered-To: freebsd-smp@freebsd.org Received: from sharmas.dhs.org (c62443-a.frmt1.sfba.home.com [24.0.69.165]) by hub.freebsd.org (Postfix) with ESMTP id 5754237B400; Fri, 8 Dec 2000 22:21:52 -0800 (PST) Received: (from adsharma@localhost) by sharmas.dhs.org (8.9.3/8.9.3) id WAA28099; Fri, 8 Dec 2000 22:20:15 -0800 Date: Fri, 8 Dec 2000 22:20:15 -0800 From: Arun Sharma Message-Id: <200012090620.WAA28099@sharmas.dhs.org> To: jhb@FreeBSD.ORG Cc: smp@FreeBSD.ORG Subject: Re: Userland atomic assignments In-Reply-To: References: Reply-To: arun@sharmas.dhs.org Sender: owner-freebsd-smp@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org On 7 Dec 2000 23:26:10 +0100, John Baldwin wrote: > a = b; should be atomic I think. If its not, then large portions of the kernel > break, IIRC. a = b, may be atomic depending on the types of a and b. On 32 bit machines, everything less than 32 bits should be atomic. However, the complexity comes from memory ordering issues. All of x86 boxes ensure sequential consistency. Some subset of Alpha boxes [1] provide a weak ordering model as a way to improve performance. On such boxes, after executing: a = b c = d (c == d) does not imply (a == b). You need to have an explicit memory barrier in between. -Arun [1] Can any Alpha gurus comment on this ? To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-smp" in the body of the message