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

Rémi

Reply via email to