A coroutine library for Rust providing asymmetric coroutines with yield/resume semantics.
coroutine-rs is a Rust library that implements coroutines, which are lightweight cooperative multitasking primitives. It allows developers to write code that can yield execution and later resume from where it left off, enabling patterns like generators, iterators, and simplified asynchronous programming within a single thread.
Rust developers working on systems programming, asynchronous applications, or those needing generator/iterator patterns without the overhead of threads. It's particularly useful for developers implementing custom concurrency models or state machines.
Developers choose coroutine-rs for its clean, minimal API and efficient implementation of coroutines in Rust. It provides a native Rust solution for cooperative multitasking without external dependencies, making it suitable for embedded systems and performance-critical applications.
Coroutine Library in Rust
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Uses assembly from libgreen for context switches, ensuring low-overhead performance as acknowledged in the thanks section of the README.
Supports multiple architectures including x86_64, i686, ARM, MIPS, and MIPSel, making it viable for embedded and cross-platform development as stated in the platform support notes.
Provides a straightforward interface for asymmetric coroutines, demonstrated in the basic usage example with Coroutine::spawn and yield_with for easy coroutine management.
Designed for cooperative multitasking within a single thread, reducing synchronization overhead compared to threading, which aligns with the library's philosophy of minimalism.
Symmetric coroutines are listed as a goal but not implemented, limiting the coroutine models available to developers who need more flexible concurrency patterns.
Only tested on specific platforms like OS X and ArchLinux with nightly Rust, as noted in the README, which may affect reliability and portability in other environments.
The README directs users to `cargo doc` for more details, indicating a lack of comprehensive guides or examples, which can steepen the learning curve.