Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 06 Sep 1996 13:03:47 -0700
From:      Wayne Scott <wscott@ichips.intel.com>
To:        "David E. Tweten" <tweten@frihet.com>
Cc:        Bruce Evans <bde@zeta.org.au>, current@freebsd.org
Subject:   Re: fixing accesses to volatile variable `time' 
Message-ID:  <199609062003.NAA29277@pdxlx008.intel.com>
In-Reply-To: Your message of "Thu, 05 Sep 1996 19:22:16 PDT." <199609060222.TAA05756@ns.frihet.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
> bde@zeta.org.au said:
> >1. time.tv_sec is long, and accesses to longs are not guaranteed to 
> >   be atomic.  They happen to be atomic on i386's.
> 
> To satisfy my curiosity, just who makes this "guarantee?"  Obviously, 
> access to a bit is inherently atomic, but I don't recall reading any C 
> language specification indicating that chars, shorts, or int accesses are 
> atomic whereas longs aren't.


Intel guarantees that 32-bit accesses on a 32-bit boundary are atomic on
all 32-bit Intel Architecture processors.

	(Pentium Pro manual volume 3 page 7-2)

So as long as you align the time data structure correctly, there is no problem.

-----------
Wayne Scott		        MD6 Architecture
wscott@ichips.intel.com		Work #: (503) 264-4165
Disclaimer:  All views expressed are my own opinions, and not necessarily 
             those of Intel Corporation.





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199609062003.NAA29277>