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

mark.reinhold at oracle.com mark.reinhold at oracle.com
Mon Dec 7 17:34:40 UTC 2015

2015/11/30 6:58 -0800, gil at azul.com:
> 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() {};
> }

I'm glad to see some agreement here, but I'm puzzled by the proposal
to to place this in the Runtime class.  What's the reasoning for that?
Wouldn't this more naturally be placed in java.lang.Thread?

Also, I don't think this single method needs a JEP, but you're welcome
to do it that way if you really want to.

- Mark

More information about the hotspot-dev mailing list