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

Chris Plummer cjplummer at openjdk.java.net
Tue Mar 9 07:32:06 UTC 2021


On Tue, 9 Mar 2021 07:03:36 GMT, Yasumasa Suenaga <ysuenaga at openjdk.org> wrote:

>> I prefer `onSpinWait()` if anything because it expects short suspend, and we can expect CPU friendly code.
>
> As an option, we can remove `steadyStateReached` and rewrite the code as following:
> 
>         steadyStateThread.setName("SteadyStateThread");
>         steadyStateThread.start();
> 
>         while (steadyStateThread.getState() != Thread.State.BLOCKED) {
>             Thread.onSpinWait();
>         }

I thought of that, but was worried that during thread startup maybe there might be a spurious short lived period where the thread was BLOCKED. Probably not possible, but I didn't want to have to go about proving as much.

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

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


More information about the serviceability-dev mailing list