11 releases (5 stable)
Uses old Rust 2015
|2.1.0||Feb 2, 2018|
|2.0.0||Jun 6, 2017|
|1.0.1||Apr 10, 2017|
|1.0.0||Mar 2, 2016|
|0.1.3||Oct 11, 2015|
#159 in Concurrency
3,633 downloads per month
Used in 13 crates (10 directly)
This project offers an easy interface to the famous Boost.Context library and thus provides the building blocks for higher-level abstractions, like coroutines, cooperative threads (userland threads) or an equivalent to C# keyword yield in C++.
context, first add this to your
[dependencies] context = "2.0"
And then add this to your source files:
extern crate context;
The performance heavily depends on the architecture and even on the operating system. A context switch itself is usually as fast as a regular function call though and can thus be viewed as one.
To see this for yourself run
cargo bench resume. You can then compare the
results of the
resume benchmarks (which uses
Context::resume()) to the
resume_reference_perf (which uses regular function calls).
|Architecture||Linux (UNIX)||Windows||MacOS X||iOS|
|i386||SYSV (ELF)||MS (PE)||SYSV (MACH-O)||-|
|x86_64||SYSV, X32 (ELF)||MS (PE)||SYSV (MACH-O)||-|
|arm (aarch32)||AAPCS (ELF)||AAPCS (PE)||-||AAPCS (MACH-O)|
|arm (aarch64)||AAPCS (ELF)||-||-||AAPCS (MACH-O)|
|ppc32||SYSV (ELF), XCOFF||-||SYSV (MACH-O)||-|
|ppc64||SYSV (ELF), XCOFF||-||SYSV (MACH-O)||-|
ABI (binary format).