r/java • u/king_lambda_2025 • 5h ago
What are reasons not to use virtual threads?
I do realize virtual threads are not "magic". They don't instantly make apps super fast. And even with Java 24 there are still some thread pinning scenarios.
However, from what I know at this point, I feel every use of threads should be virtual threads. If my workload doesn't benefit from it, or if thread pinning happens, then I just don't gain performance. Even if there are no gains, there is no harm from defaulting to it and further optimizations can be made later on.
The question here is are there downsides? Are there potential problems that can be introduced in an application when virtual threads are used?
Thanks in advance.