context

Crates.iocontext
lib.rscontext
version3.0.0
sourcesrc
created_at2015-08-09 14:25:47.592329
updated_at2023-01-25 17:08:04.11383
descriptionCooperative multitasking for Rust using Boost.Context
homepage
repositoryhttps://github.com/zonyitoo/context-rs
max_upload_size
id2800
size358,720
ty (zonyitoo)

documentation

README

context-rs

Build Status Build status License

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++.

API documentation

Usage

To use context, first add this to your Cargo.toml:

[dependencies]
context = "3.0"

And then add this to your source files:

extern crate context;

Performance

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 results of resume_reference_perf (which uses regular function calls).

Platforms

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) mips1 | O32 (ELF) | - | - | - ppc32 | SYSV (ELF), XCOFF | - | SYSV (MACH-O) | - ppc64 | SYSV (ELF), XCOFF | - | SYSV (MACH-O) | -

Format: ABI (binary format). Source: Boost.Context

Commit count: 101

cargo fmt