[jdk21u-dev] RFR: 8340547: Starting many threads can delay safepoints

Oli Gillespie ogillespie at openjdk.org
Tue Jan 28 17:08:57 UTC 2025


On Tue, 28 Jan 2025 16:44:06 GMT, Sergey Nazarkin <snazarki at openjdk.org> wrote:

> I'd like to backport this fix to fix the issue with starting a lot of threads in a burst. Some users found this to be a barrier to migrating from JDK8. 
> 
> The backport is not clean as required to adjust `globals.hpp` and replace `ConditionalMutexLocker` with classic `MutexLocker`. Original fix and discussion are [here](https://github.com/openjdk/jdk/pull/21111)
> 
> Tested with `tier1` and reproducers from [JDK-8340547](https://bugs.openjdk.org/browse/JDK-8340547), [JDK-8307970](https://bugs.openjdk.org/browse/JDK-8307970)

I'm not a reviewer but took a look since it was my original patch. Looks good to me.

src/hotspot/share/prims/jvm.cpp line 2958:

> 2956:   // in Thread::start.
> 2957:   {
> 2958:     MutexLocker throttle_ml(UseThreadsLockThrottleLock ? ThreadsLockThrottle_lock : NULL);

Should be `nullptr`, right?

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

PR Review: https://git.openjdk.org/jdk21u-dev/pull/1365#pullrequestreview-2578911283
PR Review Comment: https://git.openjdk.org/jdk21u-dev/pull/1365#discussion_r1932550522


More information about the jdk-updates-dev mailing list