6647361: use Unsafe.put*Volatile methods to set final fields during default deserialization

Rémi Forax forax at univ-mlv.fr
Mon Nov 22 14:35:36 UTC 2010

  Le 22/11/2010 14:52, Alan Bateman a écrit :
> This is a patch to default deserialization so that it uses 
> volatile-write when setting final fields:
>   http://cr.openjdk.java.net/~alanb/6647361/webrev/
> Thanks,
> Alan.

I wonder if we can't use putOrdered instead of putVolatile.
In that case Field.set() should be changed too because it uses putVolatile.

Alan, in your patch the write key is get twice,
once in setPrimFieldValues and once in setPrimFieldValue
(resp setFinalPrimFieldValue).
I think you shoud add the write key as parameter of these methods.


More information about the core-libs-dev mailing list