Zulu Community

Discussion on Zulu 9 Pre-release 6

Updated on June 28, 2016 in Zulu Releases
0 on June 28, 2016

Azul is happy to announce the availability of the June snapshot of OpenJDK 9 today.

These binaries represent a source snapshot matching OpenJDK build 123, reflecting source up to about June 15.

Azul is excited to have completed its first JEP in the Java 9 project, namely JEP 285: Spin-Wait Hints.

Simon Ritter discusses that process in his blog post here: https://www.azul.com/jep-285-small-perfectly-formed/
This introduces a new method, java.lang.Thread.onSpinWait(), to the Thread class. Thread is a pretty fundamental class in Java and in twenty years has only been modified in three previous releases.

The motivation for the change is listed in the JEP preamble here: http://openjdk.java.net/jeps/285. Some hardware platforms benefit from software indication that a spin wait loop is in progress. Some common execution benefits may be observed:

A) The reaction time of a spin wait loop construct may be improved when a spin wait hinting is used due to various factors, reducing thread-to-thread latencies in spinning wait situations.

and

B) The power consumed by the core or hardware thread involved in the spin wait loop construct may be reduced, benefiting overall power consumption of a program, and possibly allowing other cores or hardware threads to execute at faster speeds within the same power consumption envelope.

A test program that shows how to use java.lang.Thread.onSpinWait(), and measure the thread-to-thread latency improvements on applicable processors, is available here: https://github.com/giltene/GilExamples/tree/master/SpinWaitTest

Martin Thompson added a hints package to org.agrona posted here: https://github.com/real-logic/Agrona This is usage of the hint API in a non-Java-SE-version-specific library that focuses on high performance Java code. Various projects (like Aeron) are starting to use Agrona in their communications frameworks.

Specifically, the hints package includes org.agrona.hints.ThreadHints.onSpinWait() , which will end up as an efficiently inlined call to Thread.onSpinWait() when that call exists (i.e. in Zulu 9 Pre 6, now that it ships with JEP285), and as a no-op when it does not. This creates a long lasting and portable (across Java SE versions) way to hint at spinning, without needing to create different code for Java SE 9 vs. prior Java versions. The hope is that this will encourage people to use the onSpinWait() feature in code even before Java 9 comes out, and keep using it after (at least for a while, until nobody is running Java 8).

In general, OpenJDK 9 is on the cusp of reaching feature completeness. The umbrella JSR is filed and initial vote of JCP-Exec Committee approved the spec changes. Azul put Simon’s hat in the ring to join the Expert Group as well. See the vote tally, Azul comments, and other EC comments on the JCP.org site here: https://www.jcp.org/en/jsr/results?id=5851

As a reminder, formal support programs from Azul will extend to cover Zulu 9 once we reach GA. Until then, we welcome all informal Q&A here on the Zulu forum.

Please provide any feedback about this snapshot, posted http://zulu.org/zulu-9-pre-release-downloads/

Matt

  • Liked by
Reply