[concurrency-interest] Here's why Atomic*FieldReference access checking is broken

Peter Levart peter.levart at gmail.com
Wed Oct 8 10:16:09 EDT 2014


On 10/08/2014 01:19 PM, Doug Lea wrote:
>
> On 10/08/2014 05:38 AM, Peter Levart wrote:
>>
>> http://cr.openjdk.java.net/~plevart/jdk9-dev/AtomicFieldUpdater.AccessChecks/AnonClassPerCclass/AtomicIntegerFieldUpdater.java 
>>
>>
>
> Paul Sandoz has been working on VarHandles (like MethodHandles)
> for similar purposes. Possibly even the same purposes.
> See his JavaOne talk slides at
> http://cr.openjdk.java.net/~psandoz/j1-2014-unsafe-CON5150.pdf
> It seems worth waiting for more progress on this front before
> contemplating changes along these lines.
>
> -Doug
>

Thanks Doug for pointing me to Paul's slides. I can see that Paul's 
VarHandles are based around the idea of methods with polymorphic 
signature akin to MethodHandles.invoke* with the benefit that they don't 
declare Throwable as thrown exception and he's adding some type 
inference changes on top of that.

Paul is exploring alternative approaches to JEP 193 which don't require 
language changes although he has already stepped beyond that line as I 
can see that his patch contains a few lines of javac changes.

I'm trying to see if there is an alternative to Paul's approach which 
doesn't require JVM changes either. I think it all boils down to how 
types involved are encoded and how type-checks can be optimized at 
runtime. As my preliminary hacking shows, there might be a solution in 
the existing virtual machinery.

Regards, Peter



More information about the Concurrency-interest mailing list