On 03/11/2025 02:44, Danny Thomas wrote:
Hi folks,

We saw a clinit deadlock with Log4j 2 and virtual threads recently. It's common for libraries to use a mix of static and instance field loggers, so seems particularly vulnerable to this kind of deadlock at startup.

I don't recall reading what you have planned for clinit pinning, so thought I'd pass on this potentially common real-world deadlock and ask what you have in mind for addressing this limitation.

The changes to preempt when a virtual thread must wait for a class to be initialized (by another thread) have been in the loom repo for sometime. This addresses the common cases. Patricio has JDK-8369238 [1] currently in review and should be in main line (and JDK 26 EA builds) soon.

-Alan

[1] https://bugs.openjdk.org/browse/JDK-8369238

Reply via email to