Sent from my iPhone
> On 18 Dec 2016, at 13:05, Remko Popma <remko.po...@gmail.com> wrote:
> 
> I don't think we use spin locks in production code anywhere. 
> 
> The latency test has a wait strategy interface and one of the implementations 
> is spinning. I need to check the comments but not sure if I used that 
> strategy for the latency tests for the garbage free performance page. 

I just noticed that Gil Tene authored JEP 285. He is also the author of the 
Pacer class used in our latency test 
(https://github.com/apache/logging-log4j2/blob/master/log4j-core/src/test/java/org/apache/logging/log4j/core/async/perftest/ResponseTimeTest.java)

Our test checks the number of cores, and if sufficient, it uses the 
NoOpIdleStrategy (spin wait). The alternative is yielding the thread, but who 
knows when the thread gets scheduled again (and on which core - a different 
core means the cache is cold). For latency measurements of short duration, the 
hope is that a spinning wait introduces less noise. 


> 
> Sent from my iPhone
> 
>> On 18 Dec 2016, at 10:10, Matt Sicker <boa...@gmail.com> wrote:
>> 
>> I thought we were using it in AppenderControlArraySet for example, but it 
>> doesn't look like it really matches the idea. I've been reading through all 
>> the JEPs in JDK9 to see if there's anything else useful we haven't already 
>> marked in our epic <https://issues.apache.org/jira/browse/LOG4J2-1564>, and 
>> I found Thread.onSpinWait() <http://openjdk.java.net/jeps/285> which looked 
>> useful, but I'm not sure of anywhere we could use it.
>> 
>> -- 
>> Matt Sicker <boa...@gmail.com>

Reply via email to