Skip to content

PawelMarc/libfib

 
 

Repository files navigation

libfib is a library for fast and small fibers (cooperatively scheduled
userspace threads), which can load-balance an arbitrary number of
fibers onto an arbitrary number of hardware threads with
context-switch times on the order of a nanosecond (beat that,
Erlang!).

There's a few different synchronisation objects like mutexes,
condition variables, blocking channels, and an implementation of the
Actor model which has been tested up to tens of millions of actors.

To use any of this stuff, you'll need my modified version of the LLVM
compiler (see github.com/stedolan/llvm), and my patched version of the
Clang C/C++ compiler (github.com/stedolan/clang).

This is a big ugly code-dump at the moment. I'll clean up the repo
sometime... promise! (kinda).


Setting up a build environment:

git clone http://github.com/stedolan/llvm
{ cd llvm/tools; git clone http://github.com/stedolan/clang; }
{ cd llvm; ./configure && make; }

After you clone this repo, you'll need to modify LLVM_BINDIR at the
top of the Makefile and run "make plat=x86_64". If you're running on
PowerPC you'll need to have an SSH-able PPC host set up, and fiddle
with Makefile a bit (good luck, it's a mess).

fiber2.cpp is a good place to start hacking, it has examples of most
of the library's features. yield.cpp is simpler, it might be a better
testcase to determine whether clang's working.

About

A library for high-performance lightweight threads

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published