Replies: 1 comment 4 replies
-
I'd like to but for the reasons discussed in #1468, I don't consider it safe for general usage. I also don't think it should have left preview status until the pinning issue and other issues were resolved, but I understand their pressures to deliver something (especially given jigsaw, lambda, and valhalla frustrations). The next LTS seems like a good target to plan on making the switch for the default threadpool. Javalin is an example that silently switches the default pool to virtual threads. This is a bit safer because it is an application framework, so the end user can adjust the configuration if unsuitable. Caffeine is a library that may be a transitive dependency where no configuration is exposed and the user had no knowledge or choice in the matter. Take for example NewRelic APM which uses Caffeine, while the application being monitored might not. While we could add a system property to force a global setting, there is little reason for end users to know that they need to change this or suffer production issues due to the known deadlock prone behavior in the current VT implementation. I am personally very eager to see VTs being used as the default pool by A lot of the time you can just set Caffeine's executor to a caller-runs policy, e.g. |
Beta Was this translation helpful? Give feedback.
-
I knew Caffeine uses ForkJoinPool. common pool for scheduling/async working, but I sometimes saw large thread counts.
I want to switch to VirtualThread with the help of the
.executor
method, what do you think? Will caffeine change the default behavior on JDK 21, eg using VirtualThread behind the scenes?Beta Was this translation helpful? Give feedback.
All reactions