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

Paul Sandoz paul.sandoz at oracle.com
Tue Dec 1 05:36:45 EST 2015

> On 1 Dec 2015, at 03:58, 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() {};
> }

Short and sweet. I like it. I think it would be useful to add an @apiNote with explanatory text similar to that in the motivation section of the JEP.

If you like I can help guide this through the JEP process.

> 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.

I agree, the JDK and hotspot patches (for x86 support) are quite small.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 841 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://cs.oswego.edu/pipermail/concurrency-interest/attachments/20151201/5e4908d8/attachment.bin>

More information about the Concurrency-interest mailing list