[concurrency-interest] Spin Loop Hint support: Draft JEP proposal

Gil Tene gil at azul.com
Tue Dec 1 02:58:16 UTC 2015

Update: After some significant back-and-forth between Doug and I on naming and JavaDoc'ing, and with Martin (Thompson) stepping in to help, we have what we think is a good spec and name selection for this thing. We're proposing to add a new static method to the Runtime class:

class Runtime { /...
      * Method signifying that the caller is momentarily unable to
      * progress until the occurrence of one or more actions of one or
      * more other activities.  When invoked within each iteration, this
      * method typically improves performance of spin wait loop
      * constructions.
     public static void onSpinWait() {};

See updated details, including a link to the updated JEP draft, as well as links to working prototype implementations, webrevs against OpenJDK9b94, and example here: https://github.com/giltene/GilExamples/tree/master/SpinWaitTest <https://github.com/giltene/GilExamples/tree/master/SpinWaitTest> . All names have changed to reflect the new naming (onSpinWait, -XX:+UseOnSpinWaitIntrinsic, SpinWaitTest, etc.).

As an interesting stat, the total changes in the WebRevs amount to 78 added lines (across 14 files) , and 0 lines removed or changed. Hopefully a good indication of relatively low footprint and risk.

— Gil.

More information about the core-libs-dev mailing list