[jmm-dev] jdk9 APIs

Aleksey Shipilev aleksey.shipilev at oracle.com
Mon Aug 24 08:42:00 UTC 2015


On 08/21/2015 08:54 PM, Doug Lea wrote:
> On 08/21/2015 09:54 AM, Aleksey Shipilev wrote:
>>>      T compareAndExchangeVolatile(Object owner, T expected, T val);
>>>      T compareAndExchangeAcquire(Object owner, T expected, T val);
>>>      T compareAndExchangeRelease(Object owner, T expected, T val);
>>
>> Um, I have a stupid question. What's the story with non-x86 processors
>> here? Do we have any machines that do not have an explicit CAS, but only
>> have LL/SC? Returning the failure witness does not seem doable with
>> LL/SC-emulated CAS.
> 
> With LL/SC, you loop until either compare-failure with the LL'ed value
> or success of the SC. So either way there is a unique answer.

Oh, right. I was under (false) impression that you do LL/SC without
looping, but I guess that is not really viable for strong CAS emulation
since SC may "spuriously" fail.

Thanks,
-Aleksey




More information about the jmm-dev mailing list