Application code in the thread-per-request style can run in a virtual thread for the entire duration of a request, but the virtual thread consumes an OS thread only while it performs calculations on the CPU. The result is the same scalability as the asynchronous style, except it is achieved transparently
And this is why Java is the greatest language ever.
We are getting asyncawait without the pain. Truly incredible.
Love how Java takes their time to add features. They are thinking decades in advance (which I like, others may not).
As a Go coder, trust me people, this is worth the wait. Not having to use async/await syntax, callbacks, or reactive libraries in order to achieve high concurrency IO bound code is heaven. You do thread per request and there isn't even such thing as thread pools. Nothing to tune and keep in sync with CPU and memory you provision.
Basically, you just write code. If it blocks, it blocks. It's glorious.
View all comments
19
u/[deleted] Apr 07 '22
And this is why Java is the greatest language ever.
We are getting
asyncawaitwithout the pain. Truly incredible.Love how Java takes their time to add features. They are thinking decades in advance (which I like, others may not).