Hacker Timesnew | past | comments | ask | show | jobs | submitlogin

Why? You write the same code with async await but with a keyword at the beginning of every function.


Only if you ever deal with one future at a time. But async allows things like awaiting one of N events in a very natural way. Those patterns are much less readable when done with threads.


Because if you go down the callstack eventually you won't get the await keyword anymore; you'll get the actual 'waiters' and 'wakers' which define your scheduling


Yeah. The OS handles scheduling and preemption so it’s done for you rather than a call in the stack.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: