RFR: 8243455: Many SA tests can fail due to trying to get the stack trace of an active method

Yasumasa Suenaga ysuenaga at openjdk.java.net
Tue Mar 9 06:46:09 UTC 2021


On Tue, 9 Mar 2021 06:34:58 GMT, Chris Plummer <cjplummer at openjdk.org> wrote:

>> For example, can we write following code?
>> 
>> while (steadyStateThread.getState() != Thread.State.BLOCKED) {
>>     Thread.onSpinWait();
>> }
>
> Ok, that's easy enough. What about the loop before it. Do you prefer 100ms sleeps or onSpinWait() for it also.

I prefer `onSpinWait()` if anything because it expects short suspend, and we can expect CPU friendly code.

-------------

PR: https://git.openjdk.java.net/jdk/pull/2700


More information about the serviceability-dev mailing list