Hacker News new | ask | show | jobs
by bullen 285 days ago
The only new feature I might use since 1.8 (that only had NIO stability and GC improvements over 1.7) are the virtual threads without pinning in 24.
1 comments

We extensively use vars, switch expressions, collector methods, String format methods, records, instanceof narrowing. Just from the top of my head.
Same here, plus sealed classes - a very powerful feature.

What I actually haven’t used up to this point are VTs. I got a service that implements a job queue and it currently works flawlessly with scheduled executor pool. I’m reluctant to go with VTs before evaluating what implications that may have.

I think VT's are only going to be interesting if you need 1000s of them doing tiny amount of small work often.

For me I have been waiting for them for 20 years, as the blocking IO made MMO development impossible.

In the meantime we got NIO in 1.4 that only became performant and stable around 1.7 so it's been a slow progress.

I dug out my old blocking server code from back then and with a fresh coat of paint I'm ready to let the non pinned VT's rip and compare them to the NIO backend!

> For me I have been waiting for them for 20 years, as the blocking IO made MMO development impossible.

I'm not into this area of work, but wouldn’t Netty have been helpful even before VTs became available?

Netty has NIO... but back in 2000 there was no Netty. So 25 years back. JDK 1.4 with NIO came in 2002, Netty in 2004, but NIO only became usable live ~2010 with epoll and bugs got sorted end of 1.6!

Also Netty is one of those middleware "pretend to help but really bloat" libs.

I would sincerely recommend to avoid those as implementing on top of lower common denominators always is faster in the end after all the Netty bugs have been sorted.