From owner-freebsd-current Fri Sep 6 13:04:19 1996 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id NAA28140 for current-outgoing; Fri, 6 Sep 1996 13:04:19 -0700 (PDT) Received: from ormail.intel.com (ormail.intel.com [134.134.248.3]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id NAA28135 for ; Fri, 6 Sep 1996 13:04:15 -0700 (PDT) Received: from ichips.intel.com (ichips.intel.com [134.134.50.200]) by ormail.intel.com (8.7.4/8.7.3) with ESMTP id NAA06744; Fri, 6 Sep 1996 13:03:47 -0700 (PDT) Received: from pdxlx008.intel.com by ichips.intel.com (8.7.4/jIII) id NAA29547; Fri, 6 Sep 1996 13:00:30 -0700 (PDT) Received: from pdxlx008.intel.com (loopback.jf.intel.com [127.0.0.1]) by pdxlx008.intel.com (8.7.5/8.7.3) with ESMTP id NAA29277; Fri, 6 Sep 1996 13:03:47 -0700 (PDT) Message-Id: <199609062003.NAA29277@pdxlx008.intel.com> To: "David E. Tweten" cc: Bruce Evans , current@freebsd.org Subject: Re: fixing accesses to volatile variable `time' In-reply-to: Your message of "Thu, 05 Sep 1996 19:22:16 PDT." <199609060222.TAA05756@ns.frihet.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Date: Fri, 06 Sep 1996 13:03:47 -0700 From: Wayne Scott Sender: owner-current@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > 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.