News for hackers. Stuff that matters.
Re:How to think about `async`/`await` in Rust by csomar on Wednesday July 05, 2023 @07:45AM (#36598971)
This particular one, yes. However, most programs are a bit more complicated than that. That and Async is mostly used for io operations. In which case, the value here is not from non-blocking operations but from freeing up the CPU while this operation finishes execution. You can think of that as another form of executing this program on a separate thread (since the CPU will be freed to do other tasks).
Re:How to think about `async`/`await` in Rust by anonymoushn on Wednesday July 05, 2023 @07:52AM (#36599049)
Doing a blocking read also frees your CPU to do other tasks!