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

Haim Yadid haim at performize-it.com
Fri Oct 9 11:34:02 EDT 2015


+1 as well :) 

BR, 
    Haim Yadid


> On 8 באוק׳ 2015, at 17:56, Doug Lea <dl at cs.oswego.edu> wrote:
> 
>> On 10/08/2015 07:01 AM, David M. Lloyd wrote:
>>> On 10/08/2015 05:58 AM, Doug Lea wrote:
>>> 
>>> class Thread { //
>>>   /**
>>>    * A hint to the platform that the current thread is momentarily
>>>    * unable to progress. ... add more guidance ...
>>>    */
>>>   void spinYield();
> 
> should be:
>      public static void spinYield();
> 
>>> }
>>> 
>>> In principle, this would also allow the implementation to do an actual
>>> yield on uniprocessors or when the load average is high. Probably not
>>> in initial implementation though.
>>> 
>>> Adding a method to class Thread risks name clashes with existing
>>> methods introduced in subclasses. So this might need a clunkier name
>>> to effectively eliminate the possibility.
>> 
>> If the method is static, then the impact of a clashing name should be fairly
>> minimal.
> 
> Right. For statics, pretty much the only concern is whether
> reflective mechanics (Class.getMethod etc) return unexpected
> entries that would break existing code. The name "spinYield"
> seems unlikely enough to be a problem though.
> 
> -Doug
> 
> 
> _______________________________________________
> Concurrency-interest mailing list
> Concurrency-interest at cs.oswego.edu
> http://cs.oswego.edu/mailman/listinfo/concurrency-interest



More information about the Concurrency-interest mailing list