-
Notifications
You must be signed in to change notification settings - Fork 44
Java 21 virtual threads issue #625
Comments
Many thanks for your proposal. |
Thanks for considering my proposal! This change should be backward compatible. Btw, I noticed that in the Bookstore demo you already have an elegant utility class to do Reentrant locks, you may just utilize it in the core codebase. |
@hrstoyanov @hg-ms we are also moving to J21 soon after its release. we have been waiting for V threads for some time now as it fits our model of work nicely. we will move from many pool executor to the new V threads executor. |
@guykatz - Thanks! In the below issue, I suggested that you will end up forking the codebase sooner or later for that reason. So, if you are going to move forward with Java 21 virtual threads, I presume you will fork the codebase, then maybe the below issue can also be re-considered. |
@hrstoyanov I am not a microstream commiter. When I say we I meant the company I am employed in :) |
@hg-ms @fh-ms , hello, another related question, Could microstream 8.0.1 work with java 21 when tomcat uses virtual thread and some http thread will write data to microstream? I plan to upgrade my java to 21 for performance ,but I used microstream 08.01.00-MS-GA, the data is very important for me, so we need to know whether microstream 8.0.1 work with java 21 or not. thank you very much! |
@useryq8 there should be no problem upgrading to Java 21. Incidentally, there is a pending merge request to integrate Eclipse Store 1.1.0 (when released - maybe in 2 weeks or so) into Helidon 4.x. If you chose to migrate from Microstream to Eclipse Store, you will find an Eclipse store migration utility for converting your Microstream data files. |
Is your feature request related to a problem? Please describe.
The upcoming release of Java 21 will make virtual threads an official feature. And I hope the Microstream team plans to take full advantage of virtual threads! I was looking at the source code for
ObjectCopier
, and noticed that the SYNCHRONIZED java keyword is used (maybe in other places as well). The problem is that synchronized does not work well with virtual threads. This is explained here (but is a widely know issue you can google for):https://blog.fastthread.io/2023/02/28/pitfalls-to-avoid-when-switching-to-virtual-threads/
Describe the solution you'd like
Use java ReentrantLock instead:
yes, the code is less pretty, but the price is worth it....This should work fine with older Java versions as well.
The text was updated successfully, but these errors were encountered: