6647361: use Unsafe.put*Volatile methods to set final fields during default deserialization
dl at cs.oswego.edu
Mon Nov 22 15:49:35 UTC 2010
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  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.
More information about the core-libs-dev