RFR: 8288899: java/util/concurrent/ExecutorService/CloseTest.java failed with "InterruptedException: sleep interrupted"

Andrey Turbanov aturbanov at openjdk.org
Tue Jun 27 08:41:26 UTC 2023


On Sat, 3 Jun 2023 14:08:02 GMT, Doug Lea <dl at openjdk.org> wrote:

> Addresses Jdk 8288899 : java/util/concurrent/ExecutorService/CloseTest.java failed with "InterruptedException: sleep interrupted" and related issues.
> 
> This is a major ForkJoin update (and hard to review -- sorry) that finally addresses incompatibilities between ExecutorService and ForkJoinPool (which claims to implement it), with the goal of avoiding continuing bug reports and incompatibilities. Doing this required reworking internal control to use phaser/seqlock-style versioning schemes (affecting nearly every method) that ensure consistent data structures and actions without requiring global synchronization or locking on every task execution that would massively degrade performance. The previous lack of a solution to this was the main reason for these incompatibilities.

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

> 2715:         this.config = asyncMode ? FIFO : 0;
> 2716:         this.keepAlive = Math.max(unit.toMillis(keepAliveTime), TIMEOUT_SLOP);
> 2717:         int corep = Math.clamp(corePoolSize, p, MAX_CAP);

it it expected that `int corePoolSize` is now unused?

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

> 2793:             int n = (qs == null) ? 0 : qs.length;
> 2794:             for (int l = n; l > 0; --l, ++r) {
> 2795:                 int j; WorkQueue q; Thread o; // cancel tasks; interrupt workers

`int j` is unused

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

PR Review Comment: https://git.openjdk.org/jdk/pull/14301#discussion_r1243352906
PR Review Comment: https://git.openjdk.org/jdk/pull/14301#discussion_r1243349508


More information about the core-libs-dev mailing list