coroutine-rs
coroutine-rs copied to clipboard
thread safe documentation
The text "Thread-safe: can only resume a coroutine in one thread simultaneously" in the readme.md might scare people away. Is this meant to mean "does not implement send and/or sync yet" or "it is inherently unsafe to use in multiple threads"?
Specifically, it means "does not implement send and sync yet".
let coro = ...;
thread::spawn(|| {
coro.resume(); // Resume in thread 1
});
thread::spawn(|| {
coro.resume(); // Resume in thread 2
});
In this example, you resume the coroutine in two different threads simultaneously.
So in the documentation, I was planned to find a way to prevent users to do this.