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

Vitaly Davidovich vitalyd at gmail.com
Tue Dec 1 08:46:13 EST 2015


>
> Relax was a suggested name that fits with the current Linux kernel
> convention. However it was felt this suggested implementation rather than
> notifying state.


Yes, 'relax' is a well known term for this, and sticking to known
conventions/terms is desirable.  I don't see how it suggests implementation
though, nor even if it did suggest anything, why that's a bad thing.  If we
want to avoid any suggestions, let's call it "foobar" :).

The "on" prefix was suggested as the caller is notifying the runtime that
> it is in a spin-wait loop. This allows the runtime the option of reacting
> to the event, or not, and allows flexibility in how it chooses to react to
> this information. The method is not waiting; the method is notifying that
> the caller is waiting.


Yes, but we don't have Runtime.onGC() or Runtime.onRunFinalization(), and
both of those are documented as "suggesting" the VM perform those actions.
 spinLoopHint() sounded much better than what's proposed here, and carries
the suggestion/hint/optionality that's desired.  IMHO, onSpinWait() is the
least appealing options proposed thus far.


On Tue, Dec 1, 2015 at 8:17 AM, Martin Thompson <mjpt777 at gmail.com> wrote:

>
> Date: Tue, 1 Dec 2015 07:16:24 -0500
>> From: Vitaly Davidovich <vitalyd at gmail.com>
>>         <hotspot-dev at openjdk.java.net>,
>> concurrency-interest at cs.oswego.edu
>> Subject: Re: [concurrency-interest] Spin Loop Hint support: Draft JEP
>>         proposal
>>
>> 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()?
>
>
> Relax was a suggested name that fits with the current Linux kernel
> convention. However it was felt this suggested implementation rather than
> notifying state.
>
> The "on" prefix was suggested as the caller is notifying the runtime that
> it is in a spin-wait loop. This allows the runtime the option of reacting
> to the event, or not, and allows flexibility in how it chooses to react to
> this information. The method is not waiting; the method is notifying that
> the caller is waiting.
>
> Martin...
>
>
> _______________________________________________
> Concurrency-interest mailing list
> Concurrency-interest at cs.oswego.edu
> http://cs.oswego.edu/mailman/listinfo/concurrency-interest
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cs.oswego.edu/pipermail/concurrency-interest/attachments/20151201/244e048e/attachment.html>


More information about the Concurrency-interest mailing list