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.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of JEP draft

JEP draft

Photo of virtual threads

virtual threads

Photo of object monitors

object monitors

Related news:

News photo

Java 21 Virtual Threads – Dude, Where's My Lock?

News photo

JEP Draft: Support HTTP/3 in the HttpClient

News photo

Clojure: Managing throughput with virtual threads