4 ms·
Short replies coz on phone. 1. Async await is almost similar to normal looking threaded code. Just add await before a normal looking call. 2. A language could
by jeswin 10y ago
Short replies coz on phone.
1. Async await is almost similar to normal looking threaded code. Just add await before a normal looking call.
2. A language could have chosen to make it "exactly the same" by auto inserting awaits, but then you don't get to say when you don't actually want to wait. Many times you don't.
3. I agree native threads are cheap. But you still have a) thread stacks and additional control structures, b) wouldn't you have to deal with things like processor affinity? I mean, either you/lib or the kernel. And the kernel already does it for you.