News for hackers. Stuff that matters.
Re:Rust async/await hits stable tomorrow by lacker on Wednesday November 06, 2019 @02:37PM (#21466233)
If your code is simple with thread pools, it will be just as simple with async/await.

The biggest problem with thread pools is that you have a limited number of threads. Either because you set an explicit size limit, or you run out of memory. It's really annoying to debug deadlocks that happen because your thread pool is out of threads. So typically applications that use thread pools just don't use parallelism as much as they would if they could use async/await.

There isn't really any advantage of thread pools. Programming in Go, for example, it's very easy to write async calls and quite awkward to explicitly manage threads. But in practice, there are never really any reasons you miss having thread pools.

Re:Rust async/await hits stable tomorrow by gdxhyrd on Wednesday November 06, 2019 @03:25PM (#21466795)
If you are deadlocking, you have a bug. If you hit OOM, you most likely have leaks or went wild with threads or allocations.

Both of those conditions are orthogonal to async/thread pools, so what do you mean?

Re:Rust async/await hits stable tomorrow by lacker on Thursday November 07, 2019 @06:54PM (#21478727)
I mean, if your thread pool has 10 threads available, and your code attempts to run an 11th thread, you can run into a deadlock. Whereas that same code written with async/await can run fine.

You can call that "going wild with threads" but in an async/await model it is often just fine to use that many async calls.