RFR: 8354560: Exponentially delay subsequent native thread creation in case of EAGAIN [v3]

Yannik Stradmann duke at openjdk.org
Thu May 8 21:42:11 UTC 2025


On Thu, 8 May 2025 07:17:42 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> Yannik Stradmann has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision:
>> 
>>  - Merge remote-tracking branch 'upstream/master' into robust_pthread
>>  - Fix build on Windows: Sleep() only accepts milliseconds
>>  - Exponentially delay native thread creation retries
>
> src/hotspot/os/bsd/os_bsd.cpp line 647:
> 
>> 645:     pthread_t tid;
>> 646:     int ret = 0;
>> 647:     {
> 
> Why the extra block scope?

I'm limiting the visibility of the "loop" variables `trials_remaining` and `next_delay` to the loop itself, preventing accidental use further down in the function.

> src/hotspot/os/bsd/os_bsd.cpp line 661:
> 
>> 659:         }
>> 660: 
>> 661:         log_warning(os, thread)("Failed to start native thread (%s), retrying after %dus.", os::errno_name(ret), next_delay);
> 
> I don't think we want to issue a warning unless we completely fail to start the native thread. For debugging purposes this may be better as a log_debug,

ACK, fixed in all files.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24682#discussion_r2080499542
PR Review Comment: https://git.openjdk.org/jdk/pull/24682#discussion_r2080500040


More information about the hotspot-runtime-dev mailing list