Date: Wed, 26 Dec 2001 11:47:44 -0800 From: Mike Smith <msmith@freebsd.org> To: Michal Mertl <mime@traveller.cz> Cc: John Hanley <jh_@yahoo.com>, arch@freebsd.org Subject: Re: 64 bit counters Message-ID: <200112261947.fBQJliM01092@mass.dis.org> In-Reply-To: Your message of "Wed, 26 Dec 2001 17:16:28 %2B0100." <Pine.BSF.4.41.0112261654060.20665-100000@prg.traveller.cz>
next in thread | previous in thread | raw e-mail | index | archive | help
> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200112261947.fBQJliM01092>