[concurrency-interest] The very best CAS loop

Peter Levart peter.levart at gmail.com
Wed Sep 28 10:44:06 EDT 2016



On 09/28/2016 04:17 PM, Peter Levart wrote:
>
> To verify my claims, I replaced VarHandle view over direct ByteBuffer 
> with Unsafe accesses to buffer's native memory in the following benchmark:
>
> http://cr.openjdk.java.net/~plevart/misc/GetAndUpdate/GetAndUpdateBench3.java
>
>
> Can you try it on AArch64. You can replace BlackHole.consumeCPU with 
> you xhorshift loop, but I don't think you'll get much different results.

Ah, yes. To compile the bench, you must put something like the following 
into pom.xml:

             <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
                 <version>3.1</version>
                 <configuration>
<compilerVersion>${javac.target}</compilerVersion>
<source>${javac.target}</source>
<target>${javac.target}</target>
*                    <compilerArgs>**
**<arg>--add-exports</arg>**
**<arg>java.base/jdk.internal.misc=ALL-UNNAMED</arg>**
**                    </compilerArgs>*
                 </configuration>
             </plugin>

(Danger: don't do that at home, or Oracle might remove these options! ;-)...

Regards, Peter

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cs.oswego.edu/pipermail/concurrency-interest/attachments/20160928/eadf8f0a/attachment.html>


More information about the Concurrency-interest mailing list