r/java • • Apr 06 '22

JEP 425: Virtual Threads (Preview)

https://openjdk.java.net/jeps/425
175 Upvotes

50 comments sorted by

View all comments

19

u/[deleted] Apr 07 '22

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 async await 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).

5

u/Joram2 Apr 07 '22

Golang brought fast light virtual threads to the mainstream ~10 years ago. I'm still excited about Java and very excited about Loom.