RFR: JDK-8304723: Statically allocate global mutexes
Justin King
jcking at openjdk.org
Wed Mar 22 17:34:03 UTC 2023
On Wed, 22 Mar 2023 17:17:57 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:
> * we can probably switch from dyn. allocating the mutex name to keeping it inline as a static buffer. Cuts allocations down by half already. The name lengths are not that surprising, and even if we truncate (we shouldn't) it's probably fine.
This is even more invasive and should be done separately, I already noticed it. There are places where mutex/monitor are not statically allocated and we have to ensure those are also compatible with that change.
> * On posix, switch from pthread_cond_init to static initialization if possible.
The pthread_cond_init static initialization is not useful here, we are not initializing during library loading. Everything is still done during VM initialization. Trying to use pthread_cond_init static initialization would be more complex as we would then have to introduce a tag type to select which one, as one is not normally supposed to destroy statically initialized condition variables.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/13143#issuecomment-1479986388
More information about the hotspot-dev
mailing list