3 ms·
Threads are for when you COMPUTE a lot, while async/await are for when you WAIT a lot.
by lr1970 3y ago
Threads are for when you COMPUTE a lot, while async/await are for when you WAIT a lot.
- seanhunter 3y agoExactly. Nice rule of thumb.
- zozbot234 3y agoSometimes you are "computing a lot" over very general dataflow graphs and want to have tasks with work stealing. Async frameworks will give you that for free, seamlessly scaling to any number of underlying threads.
- _ahxg 3y agointeresting. I hope it's not too late to ask: could you expand a little bit, in particular, what do you mean by "over very general dataflow graphs"?