JDK-8154755 : Add a VarHandle weakCompareAndSet with volatile semantics
  • Type: Sub-task
  • Component: core-libs
  • Sub-Component: java.lang.invoke
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2016-04-20
  • Updated: 2017-05-17
  • Resolved: 2016-04-29
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9 b117Fixed
Related Reports
Relates :  
Description
VarHandle has a weakCompareAndSet method with "plain" semantics.

A compareAndSet cannot reliably be replaced with a weak variant on platforms that support LL/SC. See here for more details:

http://mail.openjdk.java.net/pipermail/jmm-dev/2016-April/000239.html

A variant with "volatile" semantics should be added e.g. weakCompareAndSetVolatile.

JDK change:
 http://cr.openjdk.java.net/~psandoz/jdk9/JDK-8154755-weak-cas-volatile/webrev/
Comments
VM change: http://hg.openjdk.java.net/jdk9/sandbox/jdk/rev/feeb57d1905e http://hg.openjdk.java.net/jdk9/sandbox/hotspot/rev/3c0279fdc797
28-04-2016