4 ms·
And where it all comes together is when async lets us write concurrent functions that compose together well in a way that functions that can block on IO and loc
by marshray 7y ago
And where it all comes together is when async lets us write concurrent functions that compose together well in a way that functions that can block on IO and lock acquision do not.
- ori_b 7y agoHow so? The same API is trivial to implement using threads and futures. A future, after all, is just a one shot channel or rendezvous point. Async is just a way to get cooperative threads compiled to a static state machine, trading lower concurrent utilization and throughput for less context switch overhead and lower latency.