On Sun, 19 Nov 2023 17:36:01 GMT, Doug Lea <d...@openjdk.org> wrote:

> This update cascades timeouts to trim subsequent workers after the first  
> keepAlive inactive period.

src/java.base/share/classes/java/util/concurrent/ForkJoinPool.java line 2140:

> 2138:             Thread.interrupted();               // clear for next park
> 2139:             if (deadline != 0L &&               // try to trim on 
> timeout
> 2140:                 deadline - System.currentTimeMillis() < TIMEOUT_SLOP) {

Since `currentTimeMillis()` is fetched from system time, I think it might be 
more appropriate to use nanoTime() to track delays.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/16725#discussion_r1399055155

Reply via email to