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

Doug Lea dl at cs.oswego.edu
Tue Dec 1 07:43:41 EST 2015

On 12/01/2015 05:36 AM, Paul Sandoz wrote:
>> On 1 Dec 2015, at 03:58, Gil Tene <gil at azul.com> wrote:
>> 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.

Or maybe not. Recent experience suggests that it is hard to add a brief
explanatory note or usage guidance without saying something
confusing or wrong wrt usages focussing on latency, throughput,
or power -- these effects may vary across processors with
different instructions (possibly just no-op) used to implement it.
Not a lot, but this accounts for the bland wording of
"typically improves performance".


More information about the Concurrency-interest mailing list