News for hackers. Stuff that matters.
Re:How to think about `async`/`await` in Rust by cassepipe on Wednesday July 05, 2023 @05:42AM (#36598005)
Isn't that problem generally easily solved with a thread pool ? (that's what nginx does I believe)
Re:How to think about `async`/`await` in Rust by miki123211 on Wednesday July 05, 2023 @07:00AM (#36598588)
There are use cases where a thread pool doesn't solve your problem. If you're handling a few short-lived connections at a time, it's more than enough, but if you're developing something like a push / messaging / queuing service, with thousands of clients connected for hours at a time and receiving very little data once every few minutes, a thread pool won't help you.
Re:How to think about `async`/`await` in Rust by starcraft2wol on Wednesday July 05, 2023 @01:02PM (#36603341)
> a thread pool won't help you.

What do you see as the main limitations of spawning 2048 threads in a pool in this scenario?

Re:How to think about `async`/`await` in Rust by super_flanker on Wednesday July 05, 2023 @05:29PM (#36607430)
2048 threads would be fine, but they are talking about 10s of thousands of clients.
Re:How to think about `async`/`await` in Rust by usrbinbash on Thursday July 06, 2023 @05:50AM (#36613564)
This is a solved problem.

I can run millions of goroutines on a laptop. These get mapped to a relatively small number (number of available CPU cores with default settings) by the runtime.