3 ms·
libdill and co implement stackful coroutines. Each coroutine has a native call stack which gets swapped out by a userspace scheduler. Rusts proposed coroutines
by Matthias247 8y ago
libdill and co implement stackful coroutines. Each coroutine has a native call stack which gets swapped out by a userspace scheduler. Rusts proposed coroutines and async functions are stackless. They are implemented as pure Compiler Transformations, and don’t allow to yield at arbitrary points.
Rust actually had stackless coroutines in the past (libgreen), but moved from it due to the overhead it brought for code that didn’t require it.