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

It's faster than multiple threads even on a single core. There are syscalls involved to wait, and to wake up. That doesn't matter for I/O, since syscalls are involved anyway, but it does for mutexes and condition variables. With async, handing off control to one or more other tasks is cheap (tokio around 100 ns), for threads it's more expensive (2-3 us).

And of course with threads it's harder to actually run single-core, you need to dedicated a specific core which brings operational complexity.



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

Search: