4 ms·
This is some bullshit. And it doesn't help that everyone is using async to mean different things. Blocking/synchronous system calls are not friendly to userspa
by anacrolix 2y ago
This is some bullshit. And it doesn't help that everyone is using async to mean different things.
Blocking/synchronous system calls are not friendly to userspace async runtimes. Explicit async runtimes are a pain in the ass. The best solution imo is a blocking userspace interface that maps into the system however it likes. Go and Haskell do this. Erlang and probably all BEAM languages do too. Nim and Zig let you choose.
Runtimes like Go and Haskell can map onto code that makes blocking system calls for compatibility reasons when needed, through explicit request to the runtime, or detecting that a green thread has blocked.
- smw 2y agoThis is the right answer! Preemptively scheduled n:m green threads >>>> any async design.
- hinkley 2y agoI’ve always thought of async await as an ergonomic relaxation (as in constraints) of green threads. People had more problems doing green threads right than I’ve seen with async. Do some of the remaining problems look exactly like green thread problems? Absolutely. But it’s a step toward something more hygienic.