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

Vitaly Davidovich vitalyd at gmail.com
Tue Dec 1 07:16:24 EST 2015


Minor quibble, but why the "on" prefix in the name? Maybe just me, but
onXYX is typically used for event notification style APIs.

Also, the "wait" part seems inappropriate as the method itself isn't doing
any waiting.  What was wrong with the original spinLoopHint name? Or
cpuRelax()?

sent from my phone
On Nov 30, 2015 9:59 PM, "Gil Tene" <gil at azul.com> wrote:

> 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.
>
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cs.oswego.edu/pipermail/concurrency-interest/attachments/20151201/bf1ddcd8/attachment.html>


More information about the Concurrency-interest mailing list