Scratchpad r76 (See the current copy)
- Random Demonstrations
- Information about Roy Keene
- Information about Threads
- Random Links
- Information about Tcl
- Random Scripts
Feel free to contact me about this website at mailto:wiki@rkeene.org
- My Scratchpad
- Information about Random Number Generation
- Information about interesting Current Projects
What you will find here
Libfiber
Simple Fiber Library
http://evanjones.ca/software/threading.html [1]
Implementation of fibers (for cooperative threading) using 3 different techniques:
- setjmp()/longjmp()
- ucontext()
- Linux's clone()
Each implementation provides the same API, so they can be used interchangeably.
Mirror of source: http://www.rkeene.org/projects/info/resources/threads/libfiber/libfiber.tar.gz
Sample application using Libfiber: http://www.rkeene.org/projects/info/resources/threads/test1-lf.c
Compile:
- $ cc -o test1-lf test1-lf.c libfiber-sjlj.c; or
- $ cc -o test1-lf test1-lf.c libfiber-uc.c; or
- $ cc -o test1-lf test1-lf.c libfiber-clone.c