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.
AFAIK, preview features are production ready, but APIs are evolving and not stable. You can use virtual threads in production Java apps now, with Java 19. Major frameworks will want to hold off until the feature is out of preview and is stable. But for small teams, evolving APIs aren't a big deal, virtual threads are ready to use.
The preview features JEP says not to enable preview features and let your jars escape into the wild, which for many people "put into production" would qualify as.
Even if a small team wants to use the preview feature now, they likely won't be able to unless they can guarantee that their software will run on exactly JDK 19. Keep in mind that the code won't run on JDK 20 without a recompile, even if the API doesn't change, due to the special bits set in the classfile versions. If you're delivering a jar to someone else to run, that's unlikely to be acceptable.
So I guess you could deploy the new features into production if you were making a saas thing and control the environment your code runs in? I think for most people it makes more sense to treat preview as "ready to try out in a testing environment/on a branch", instead of "ready for use in production".
The preview features JEP says not to enable preview features and let your jars escape into the wild,
That's true in general, but more relevant to language preview features. Because virtual threads use the existing Thread API (for the most part), you don't really have to compile many libraries that are designed for virtual threads with --enable-preview. Only thread creation needs to use new APIs, but that could be factored out to a ThreadFactory provided by the application. In fact, there are already some libraries designed for virtual threads out there, including the Oracle JDBC driver.
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.