From owner-cvs-all Thu Oct 1 13:07:35 1998 Return-Path: Received: (from daemon@localhost) by hub.freebsd.org (8.8.8/8.8.8) id NAA23381 for cvs-all-outgoing; Thu, 1 Oct 1998 13:07:35 -0700 (PDT) (envelope-from owner-cvs-all) Received: from apollo.backplane.com (apollo.backplane.com [209.157.86.2]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id NAA23363; Thu, 1 Oct 1998 13:07:29 -0700 (PDT) (envelope-from dillon@backplane.com) Received: (dillon@localhost) by apollo.backplane.com (8.9.1/8.6.5) id NAA05774; Thu, 1 Oct 1998 13:07:14 -0700 (PDT) Date: Thu, 1 Oct 1998 13:07:14 -0700 (PDT) From: Matthew Dillon Message-Id: <199810012007.NAA05774@apollo.backplane.com> To: Guido van Rooij , Poul-Henning Kamp , John Birrell , cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG Subject: Re: cvs commit: src/lib/libc_r/uthread uthread_gc.c Makefile.inc uthread_init.c uthread_find_thread.c uthread_kern.c uthread_create.c uthread_exit.c References: <199810011956.MAA05613@apollo.backplane.com> Sender: owner-cvs-all@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk : The only thing you can assume as being atomic is a read or write, never : a read-modify-write, because you never know what kind of optimizations : (or lack thereof) the compiler will perform and also because some cpu's : simply do not have a locked RMW capability. oops, I meant a 'volatile read or write'. aka, to guarentee read or write atomicy is to guarentee read or write ordering, as in the following example. Any compiler which reorders the stores in this case (or the loads in the read case) is broken. volatile int a; volatile int b; code() { a = 1; b = 2; } -Matt Matthew Dillon Engineering, HiWay Technologies, Inc. & BEST Internet Communications & God knows what else. (Please include original email in any response)