A Dev Persepctive on Java Loom
Presented at EclipseCon 2023 in Ludwigsburg, Germany by Jean-François James (Worldline).
One of the main drawback of Java backend applications is that they spend most of their time waiting: for the disk, the network, the database… And with the classical thread-per-request model, we end up with lot of threads just doing … nothing! This situation is no longer acceptable with native cloud applications and modern hardware.
This is precisely what Project Loom want to tackle with 3 new features: Virtual Threads, Structured Concurrency and Scoped Variables. Virtual Threads have been around for a while and will become a stable feature with Java 21 the next LTS version planned in September. So it's coming very soon!
As Java developers, this prospect is not without questions:
Will the promises of performance improvements always be there?
What about monitoring and observability?
How will the Java ecosystem adapt: frameworks, libs, specifications?
Will we have to change our software architectures?
Will we have to change our business code?
Will asynchronous programming become obsolete?
What about the impacts on deployments?
In a nutshell, should we care about Loom, why and how?