[concurrency-interest] Spin Loop Hint support: Draft JEP proposal
Viktor Klang
viktor.klang at gmail.com
Tue Dec 1 12:47:43 UTC 2015
While we are painting the bikeshed, what about `powerNap()`
On Tue, Dec 1, 2015 at 1:16 PM, Vitaly Davidovich <vitalyd at gmail.com> wrote:
> 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.
>>
>>
>>
>>
>>
>>
> _______________________________________________
> Concurrency-interest mailing list
> Concurrency-interest at cs.oswego.edu
> http://cs.oswego.edu/mailman/listinfo/concurrency-interest
>
>
--
Cheers,
√
More information about the core-libs-dev
mailing list