std::task
std::task provides hosted task/runtime helpers, including sleep/yield
operations.
Full reference: task.
Example#
import std::task;
fn main () -> int {
let n: int = available_parallelism();
yield_now();
sleep_ms(0);
if n < 1 { return 1; }
return 0;
}
See also#
- Full reference: task
- Concurrency model: concurrency
Source repository · Edit this page · View Markdown