A Rust library implementing safe, lightweight context switches, without relying on kernel services
Go to file
edef 709dad1c4a add Context::swap2, to allow distinct save/restore contexts
Fix #5

Context::swap is now implemented in terms of Context::swap2, and it
might make sense to remove Context::swap entirely at some point.
2016-03-22 07:50:50 +01:00
.travis/docs run on Travis CI container infra 2015-04-19 15:40:43 -04:00
benches get rid of some minor warnings 2016-03-22 07:35:25 +01:00
examples use Void to ensure closure diverges 2015-08-26 00:51:18 +02:00
src add Context::swap2, to allow distinct save/restore contexts 2016-03-22 07:50:50 +01:00
.editorconfig add .editorconfig 2015-04-16 04:17:55 -04:00
.gitignore initial commit 2014-12-23 04:27:28 +01:00
.travis.yml run Cargo in verbose mode on Travis CI 2016-03-16 09:09:36 +01:00
Cargo.toml use libvalgrind instead of valgrind.h 2016-01-04 15:34:41 +01:00
LICENSE use libvalgrind instead of valgrind.h 2016-01-04 15:34:41 +01:00
README.md point Travis CI badge at master 2015-07-22 17:16:49 -04:00

README.md

travis rustdoc

libfringe

libfringe is a low-level green threading library for Rust. It's usable in freestanding environments (like kernels), but it can also provide an easy-to-use stack allocator using your operating system's memory mapping facility.

Performance

libfringe does context switches in 3.5ns flat on x86_64!

test swap ... bench:         7 ns/iter (+/- 0)

…and on x86, a mere 2.5ns!

test swap ... bench:         5 ns/iter (+/- 1)

Limitations

libfringe currently doesn't work on anything but x86 and x86_64, and is untested on anything but Linux.

Installation

libfringe is a Cargo package. It's not stable software yet, so you'll have to use it as a git dependency. Add this to your Cargo.toml:

[dependencies.fringe]
git = "https://github.com/edef1c/libfringe.git"

Feature flags

libfringe provides several optional features through Cargo's feature flags. Currently, all of them are enabled by default.

valgrind

Valgrind integration. libfringe will register context stacks with Valgrind.

os

Built-in stack allocator using your your operating system's anonymous memory mapping facility. Currently only available for Unix.