On Fri, 24 Apr 2026 12:06:12 GMT, Jorn Vernee <[email protected]> wrote:
>> test/jdk/java/lang/LazyConstant/LazyConstantSafePublicationTest.java line
>> 158:
>>
>>> 156: long deadline = System.nanoTime() +
>>> Utils.adjustTimeout(TimeUnit.MINUTES.toNanos(4));
>>> 157: while (t.isAlive()) {
>>> 158: t.join(TimeUnit.SECONDS.toMillis(20));
>>
>> Does this t.join() need use the Utils.adjustTimeout
>
> Right, I think all the times need to use adjustTimeout probably. Including
> the one in Producer.
>
> Looking at the current test code, I'm not sure why there is a delay in the
> producer. I think what's happening is that the producers is not being
> scheduled, and the consumers, which are stuck waiting for it, will wait
> forever.
The timer here is only for printing out how far each thread has advanced in the
computation. So, I think we can keep it as it is.
The spin wait in the Producer is to "throttle" the computation of the LCs'
content (1 us between computations nominally). That means the entire array of
LCs is successively computed over 100 ms. We could scale this timer as well. I
will update accordingly.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/30832#discussion_r3147519682