From owner-freebsd-arch Wed Dec 26 11:40:18 2001 Delivered-To: freebsd-arch@freebsd.org Received: from mass.dis.org (mass.dis.org [216.240.45.41]) by hub.freebsd.org (Postfix) with ESMTP id 9870837B437 for ; Wed, 26 Dec 2001 11:40:10 -0800 (PST) Received: from mass.dis.org (localhost [127.0.0.1]) by mass.dis.org (8.11.6/8.11.3) with ESMTP id fBQJliM01092; Wed, 26 Dec 2001 11:47:45 -0800 (PST) (envelope-from msmith@mass.dis.org) Message-Id: <200112261947.fBQJliM01092@mass.dis.org> X-Mailer: exmh version 2.1.1 10/15/1999 To: Michal Mertl Cc: John Hanley , arch@freebsd.org Subject: Re: 64 bit counters In-reply-to: Your message of "Wed, 26 Dec 2001 17:16:28 +0100." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 26 Dec 2001 11:47:44 -0800 From: Mike Smith Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG > On Tue, 25 Dec 2001, John Hanley wrote: > > > My only caution is this: > > > > On some platforms, 64 bit ints are not atomically written. > > First 32 bits is written, then the remaining 32. If, say, > > only the bottom half of the kernel accesses the counter, > > What do you mean by "the bottom half of the kernel"? Consider the case where two threads are updating the counter at the same time; the only solution for this is a lock around the counter which makes it much more expensive. > > then likely all is well. If an interrupt routine can read > > or write in the middle of a non-atomic operation, then all > > hell can break loose, in ways that are extremely difficult > > to track down because they only happen rarely. > > > > Well I didn't think of that but I believe it shouldn't be that much a > problem. At most the counter could become wrong :-). This would be completely unacceptable. -- ... every activity meets with opposition, everyone who acts has his rivals and unfortunately opponents also. But not because people want to be opponents, rather because the tasks and relationships force people to take different points of view. [Dr. Fritz Todt] V I C T O R Y N O T V E N G E A N C E To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message