On 11/22/10 10:41, Alan Bateman wrote:
Brian Goetz wrote:
Is it possible to coalesce the fences so that we don't incur them on every
field write?
I've also been concerned about performance. As I understand it, but maybe I have
it wrong, is that the JLS [1] doesn't allow this when changing final fields
after an object is constructed.
In the case of volatile writes, hotspot already does
some safe (short-horizon) coalescing at instruction generation
time. In the case of store fences (i.e., putOrdered), it doesn't,
but it wouldn't help on most platforms anyway.
-Doug