Virtual threads delivered. They are like Goroutines but the Structured Concurrency API really makes it better. Will any of this be out of preview for the next LTS release?
Amber is making amazing progress. The exhaustiveness checker still needs improvement, but great job.
Panama looks awesome for projects that have to interop outside of the JVM
If Valhalla really delivers in Java 20 or 21 and value/primitive types provide performance improvements, that will be a home run for the Java team.
Completely pulling virtual threads seems quite unlikely. The preview status just means that the Java devs are warning that they may change APIs. For smaller projects that often isn't a big deal, but for bigger projects that span lots of different developers in different companies, breaking changes are a big deal.
Preview means that the API might change a little, not "not cleared for use in production." It's true that you shouldn't distribute libraries compiled with with --enable-preview, but because virtual threads use the same Thread API, that's not really necessary anyway (in fact, there are some libraries designed for virtual threads out there, including the Oracle JDBC driver).
However, that's not to say there's no risk to using virtual threads in production -- not because they're in preview, but because they're new. New features are more likely to have more bugs than mature features.
In short, you can use virtual threads in production if:
You accept the risk that the API could change somewhat and you might need to change your code.
You accept the risk of using a new feature (regardless of it being in preview).
90
u/Joram2 Sep 20 '22
Congrats Java team!
Virtual threads delivered. They are like Goroutines but the Structured Concurrency API really makes it better. Will any of this be out of preview for the next LTS release?
Amber is making amazing progress. The exhaustiveness checker still needs improvement, but great job.
Panama looks awesome for projects that have to interop outside of the JVM
If Valhalla really delivers in Java 20 or 21 and value/primitive types provide performance improvements, that will be a home run for the Java team.