RFR: 8373118: Test java/lang/Thread/virtual/Starvation.java timed out [v21]
Doug Lea
dl at openjdk.org
Sun Jan 11 17:28:26 UTC 2026
On Thu, 8 Jan 2026 23:22:30 GMT, Viktor Klang <vklang at openjdk.org> wrote:
>> That loop rereads q.array on each iteration, which means it is never stale. It's possible ito nstead check for staleness and rescan if so. I just tried a version with this, but it's not looking any better.
>
> Yeah, I was just thinking that the `array`-field is non-volatile so a read isn't guaranteed to yield anything new unless that read is piggybacking on some other fence.
The t = U.getReferenceAcquire(...) is doing a lot of work here. Every read after it must be freshly accessed. Thanks for the implicit reminder though that I should do almost all those subsequent reads until CAS at once.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/28797#discussion_r2679934255
More information about the core-libs-dev
mailing list