[concurrency-interest] spinLoopHint() JEP draft discussion

Andrew Haley aph at redhat.com
Tue Oct 13 05:44:08 EDT 2015


On 12/10/15 21:38, Justin Sampson wrote:
> Andrew Haley wrote:
> 
>> On 11/10/15 17:42, thurstonn wrote:
>>
>>> How exactly does this work?
>>> My understanding (very, very limited), was that MWAIT works with
>>> a memory address, pseudo:
>>> "continue execution upon a write to memory location X" ,
>>> but the proposed spinLoopHint() doesn't take any argument.
>>
>> spinLoopHint() is just a PAUSE instruction.  It's not an MWAIT.
> 
> Somewhere along the way, Doug had mentioned MWAIT as a different but
> related concept:  PAUSE is to yield() as MWAIT is to park().

That was me, really: I'm looking for a nice way to handle WFE on
AArch64 and mentioned it on the HotSpot list.

Hans's reference to Synchronic objects is interesting but I can't
quite see how to make it fit Java.  I'm wondering if a flyweight
version of park() with a timeout might do the job, but it's not
perfect because you can't communicate any information through a
synchronization value.  Still, it would be faster than what we
have at the moment.

Andrew.


More information about the Concurrency-interest mailing list