Draft JEP on enhanced volatiles

Remi Forax forax at univ-mlv.fr
Mon Feb 10 08:06:08 UTC 2014

On 02/10/2014 04:24 AM, Tom Hawtin wrote:


>> We also considered expanding reliance on
>> java.util.concurrent.atomic FieldUpdaters, but their dynamic overhead
>> and usage limitations make them unsuitable. Several other alternatives
>> (including those based on field references) have been raised and
>> dismissed as unworkable on syntactic, efficiency, and/or usability
>> grounds over the many years that these issues has been discussed.
> If the proposed language changes were to be implemented as method 
> handles, is there any reason why the updaters couldn't be implemented 
> in an equivalent fashion?

The updater API in case of objects (AtomicReferenceFieldUpdater) rely on 
generics to enforce type safety,
because generics are erased at runtime the implementation has to do 
several runtime class checks in order to guarantee safety.

and nobody wants reified generics because among other ugly details it 
will bound the JVM to the Java type system,
hence the idea to have a new API.

> Tom


More information about the core-libs-dev mailing list