Re: JavaMemoryModel: Issue with final fields

From: Cliff Click (Cliff.Click@sun.com)
Date: Mon Feb 04 2002 - 02:05:34 EST


Eliot Moss wrote:

> Yes, with the possible exception of values that cannot be written with a
> single write, which might apply to longs on some hardware architectures,
> etc. I believe that all popular machines can write all Java primitive types
> in a single write, avoiding such splitting. Anyone know anything to the
> contrary, or prepared to speak to this question more authoritatively?

Intel definitely has to go through hoops to avoid splitting longs.
Near as I can tell, your best bet is to load a long as an 80-bit FP
type, then store it as 64 bits. No rounding, obviously, and no
funny alignment (all your long fields gotta be aligned, not too hard).
HotSpot doesn't do it unless you specify volatile. I.e., Bill Pugh's
long-splitting definitely witnesses split non-volatile longs on my PC.

Cliff

-------------------------------
JavaMemoryModel mailing list - http://www.cs.umd.edu/~pugh/java/memoryModel



This archive was generated by hypermail 2b29 : Thu Oct 13 2005 - 07:00:38 EDT