Re: RFR: 8373118: Test java/lang/Thread/virtual/Starvation.java timed out [v28]

2026-02-09 Thread Doug Lea
On Fri, 23 Jan 2026 13:10:49 GMT, Viktor Klang  wrote:

>> Doug Lea has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   Try out different approach
>
> src/java.base/share/classes/java/util/concurrent/ForkJoinPool.java line 1303:
> 
>> 1301: U.putReferenceVolatile(this, ARRAY, newArray);
>> 1302: if (unlock != 1)
>> 1303: phase = unlock;
> 
> Not sure if it helps, but if we can piggyback on the volatile write to phase, 
> then we could structure it like so:
> 
> 
> if (unlock != 1) {
> U.putReference(this, ARRAY, newArray);
> phase = unlock;
> } else {
> U.putReferenceVolatile(this, ARRAY, newArray);
> }

Good idea. Will do.

> src/java.base/share/classes/java/util/concurrent/ForkJoinTask.java line 643:
> 
>> 641:  */
>> 642: public final ForkJoinTask fork() {
>> 643: Thread t; ForkJoinWorkerThread wt;
> 
> @DougLea Btw, we can likely remove noUserHelp and setNoUserHelp (and 
> associated bits).

The bit is still needed in FJT awaitDone, and the method might be useful 
elsewhere even though it's no longer used with signalling because the other 
changes make it not worthwhile.

-

PR Review Comment: https://git.openjdk.org/jdk/pull/28797#discussion_r2779788838
PR Review Comment: https://git.openjdk.org/jdk/pull/28797#discussion_r2779768384


Re: RFR: 8373118: Test java/lang/Thread/virtual/Starvation.java timed out [v28]

2026-01-23 Thread Viktor Klang
On Wed, 21 Jan 2026 16:35:41 GMT, Doug Lea  wrote:

>> Changes signal filtering to avoid possible starvation
>
> Doug Lea has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Try out different approach

src/java.base/share/classes/java/util/concurrent/ForkJoinTask.java line 643:

> 641:  */
> 642: public final ForkJoinTask fork() {
> 643: Thread t; ForkJoinWorkerThread wt;

@DougLea Btw, we can likely remove noUserHelp and setNoUserHelp (and associated 
bits).

-

PR Review Comment: https://git.openjdk.org/jdk/pull/28797#discussion_r2721550518


Re: RFR: 8373118: Test java/lang/Thread/virtual/Starvation.java timed out [v28]

2026-01-23 Thread Viktor Klang
On Wed, 21 Jan 2026 16:35:41 GMT, Doug Lea  wrote:

>> Changes signal filtering to avoid possible starvation
>
> Doug Lea has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Try out different approach

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

> 1301: U.putReferenceVolatile(this, ARRAY, newArray);
> 1302: if (unlock != 1)
> 1303: phase = unlock;

Not sure if it helps, but if we can piggyback on the volatile write to phase, 
then we could structure it like so:


if (unlock != 1) {
U.putReference(this, ARRAY, newArray);
phase = unlock;
} else {
U.putReferenceVolatile(this, ARRAY, newArray);
}

-

PR Review Comment: https://git.openjdk.org/jdk/pull/28797#discussion_r2721138435


Re: RFR: 8373118: Test java/lang/Thread/virtual/Starvation.java timed out [v28]

2026-01-22 Thread Viktor Klang
On Wed, 21 Jan 2026 16:35:41 GMT, Doug Lea  wrote:

>> Changes signal filtering to avoid possible starvation
>
> Doug Lea has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Try out different approach

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

> 1458: ++taken;
> 1459: }
> 1460: return taken;

Since `q` can never be null, and `task` initially is never null, perhaps we 
could do:


final int topLevelExec(ForkJoinTask task, WorkQueue q, ForkJoinPool 
pool,
   int fifo) {
int taken = 0;
if (task != null && q != null) {
ForkJoinPool p = (fifo == 0) ? null : pool;
do {
task.doExec();
++taken;
} while ((task = nextLocalTask(fifo)) != null || (task = 
q.tryPoll(p)) != null));
}
return taken;
}

-

PR Review Comment: https://git.openjdk.org/jdk/pull/28797#discussion_r2717771468


Re: RFR: 8373118: Test java/lang/Thread/virtual/Starvation.java timed out [v28]

2026-01-21 Thread Doug Lea
> Changes signal filtering to avoid possible starvation

Doug Lea has updated the pull request incrementally with one additional commit 
since the last revision:

  Try out different approach

-

Changes:
  - all: https://git.openjdk.org/jdk/pull/28797/files
  - new: https://git.openjdk.org/jdk/pull/28797/files/a1e5ce94..02ddb13d

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=28797&range=27
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28797&range=26-27

  Stats: 204 lines in 1 file changed: 79 ins; 75 del; 50 mod
  Patch: https://git.openjdk.org/jdk/pull/28797.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/28797/head:pull/28797

PR: https://git.openjdk.org/jdk/pull/28797