News for hackers. Stuff that matters.
Re:Rust without the async (hard) part by sealeck on Thursday June 09, 2022 @12:39PM (#31683404)
https://github.com/jimblandy/context-switch/ suggests that it's not substantially better
Re:Rust without the async (hard) part by api on Thursday June 09, 2022 @12:52PM (#31683612)
Interesting, but there are other issues. A big one is resource exhaustion attacks. A thread per connection means that someone can trivially exhaust system memory, while async pseudo-threads (tiny bits of state) take up virtually no space.

Edit: also this only tests 500, not 500000.

Also when doing threaded I/O as soon as you want to support bidirectional traffic you will have to implement select/poll/etc. since you can't do a blocking read and a blocking write at the same time on one thread. At that point you're already giving up a lot of the advantages of threads.