Get the latest tech news
JEP Draft: Adapt Object Monitors for Virtual Threads
Summary Change the HotSpot VM implementation of object monitors to allow a virtual thread unmount from its carrier thread when inside a synchronized block or method, when blocking to gain ownership of a monitor, or when waiting in Object.wait. Goals - Eliminate the so-called pinning issues with object monitors that can currently harm scalability and performance when used with virtual threads.
Change the HotSpot VM implementation of object monitors to allow a virtual thread unmount from its carrier when it executes code that: These changes remove the so-called pinning issues with object monitors and allow more existing Java libraries be used with virtual threads without needing to modify code. There are also many challenges with the approach in areas such as JNI locking, several features of JVM TI, and the JVMS requiring that a monitor be automatically exited in all cases.
Or read this on Hacker News