News for hackers. Stuff that matters.
Re:Networking I/O with Virtual Threads – Under the hood by riobard on Thursday July 08, 2021 @01:59AM (#27768846)
> on modern processors a couple thousand mostly idle (due to IO blocking) Java threads are fine

This “mostly idle” assumption is gonna break the moment you hit a load spike and wake up most of those “idle” threads.

The success of async is often (mis)attributed to eliminating unnecessary resources, but in practice it's actually because async model implicitly enforces an invisible job queue, where usually only a single process/thread per core is heavy lifting the actual work, and async I/O will feed processing pressure back to the load source via network (e.g. TCP ACK).

Re:Networking I/O with Virtual Threads – Under the hood by fulafel on Thursday July 08, 2021 @02:57AM (#27769074)
I'm not sure scheduling the work in your own process necessarily solves the load problem better? The described queue behaviour would happen in the OS in the threads scenario, and TCP would work the same too.
Re:Networking I/O with Virtual Threads – Under the hood by riobard on Thursday July 08, 2021 @10:50AM (#27772683)
It's not about which way is better, but which default is more useful in practice.