Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
coroutine-rs
Coroutine library in Rust
[]
= "https://github.com/rustcc/coroutine-rs.git"
or
[]
= "*"
Usage
Basic usage of Coroutine
extern crate coroutine;
use Coroutine;
This program will print the following to the console
1. Hello in coroutine!
2. We are here!
3. We are back!!
4. Begin counting ...
Counting 0
Counting 1
Counting 2
Counting 3
Counting 4
5. Counting finished
6. Good bye
7. Back to main.
For more detail, please run cargo doc --open
.
Features
-
Feature
enable-clonable-handle
is enabled by default. The Coroutine is thread-safe, so the handle (coroutine::Handle
) is clonable. -
If the feature
enable-clonable-handle
is disable, the handle will become unique, which may improve context switch performance because no lock is required.
Goals
-
Basic single threaded coroutine support
-
Clonable coroutine handle
-
Unique coroutine handle (for special usage)
-
Thread-safe: can only resume a coroutine in one thread simultaneously
-
Multithreaded scheduler with work stealing feature
-
Asynchronous I/O supports
Notes
-
Currently this crate can only be built with Rust nightly because of some unstable features.
-
Basically it supports arm, i686, mips, mipsel and x86_64 platforms, but we have only tested in
-
OS X 10.10.*, x86_64, nightly
-
ArchLinux, x86_64, nightly
-
Thanks
- The Rust developers (context switch ASM from libgreen)