From owner-cvs-all Fri Oct 2 09:52:53 1998 Return-Path: Received: (from daemon@localhost) by hub.freebsd.org (8.8.8/8.8.8) id JAA28700 for cvs-all-outgoing; Fri, 2 Oct 1998 09:52:53 -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 JAA28344; Fri, 2 Oct 1998 09:52:01 -0700 (PDT) (envelope-from dillon@backplane.com) Received: (dillon@localhost) by apollo.backplane.com (8.9.1/8.6.5) id JAA10544; Fri, 2 Oct 1998 09:46:55 -0700 (PDT) Date: Fri, 2 Oct 1998 09:46:55 -0700 (PDT) From: Matthew Dillon Message-Id: <199810021646.JAA10544@apollo.backplane.com> To: Bruce Evans Cc: cvs-all@FreeBSD.ORG, cvs-committers@FreeBSD.ORG, guido@gvr.org, jb@FreeBSD.ORG, phk@critter.freebsd.dk 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: <199810020302.NAA10722@godzilla.zeta.org.au> Sender: owner-cvs-all@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk :> volatile int a; :> volatile int b; :> :> code() { :> a = 1; :> b = 2; :> } : :`volatile' is not necessary here in practice, since Standard C requires :stores to act as if they are complete at sequence points, and compilers :attempt to implement Normal C which requires everything to work Normally :in signal handlers. : :Bruce Uhh.... I really, really, really doubt you can count on that for variable operations that do not cross a procedure boundry and do not use the 'volatile' keyword. The peephole optimizer alone may reorder non-volatile global loads into registers. Also, if you do not declare the global volatile, the compiler may optimize out 'redundant' loads that are, in fact, not redundant in a volatile situation. -Matt Matthew Dillon Engineering, HiWay Technologies, Inc. & BEST Internet Communications & God knows what else. (Please include original email in any response)