Are virtual threads supported in any of the latest Open Liberty versions? If yes, how can I switch them on?
The article that Jared refers to is now published on InfoQ.com: https://www.infoq.com/articles/java-virtual-threads-a-case-study/
The article mainly discusses what our performance team found when they compared Java Virtual Threads with Open Liberty's own autonomic thread pool. As Jared said, the decision was made not to replace Liberty's existing thread pool for now. But you can still run apps on Liberty using virtual threads - the unexpected behaviours reported in the article might be useful, however, to understand in case they're relevant to your app.
We will add something to the Open Liberty blog too. :)
Concurrency 3.1 for Jakarta EE 11 provides support for virtual threads when using Jakarta Concurrency APIs.
The Liberty 24.0.0.5-beta beta blog post provides details about Liberty's beta support for Jakarta Concurrency 3.1.
In general Liberty does not use virtual threads for its main thread pool due to some issues with performance with virtual threads on different linux kernel levels. We find that our existing main thread pool that grows and shrinks automatically in order to handle the work being done in the server performs better than virtual threads. You can read more about Liberty's thread pool in this blog post. An article about our experiments with virtual threads should be coming out in a few weeks.
Otherwise with Liberty supporting Java 21 starting with 23.0.0.10 as discussed in the 23.0.0.10 release blog post, applications are free to use virtual threads if they are using Java 21 or 22. For application context you will need to use the Jakarta Concurrency APIs of course.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With