Skip to content

ejcaruso/fthreads

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

femtothreads

Small threading library to demonstrate how one might implement threads on an x86 CPU. Not meant to be used for any heavy-duty lifting, and is meant for learning.

Try it out

Run make to get a binary called echo_server in the example directory, which shows how you can use fthreads to write a simple, multithreaded network server without having to change much from a pthreads implementation.

Use it yourself

Wanna take it for a spin? Just #include <fthread.h> in your project, and compile with -lfthread.

Interesting tidbits

In addition to userland context switching, fthreads provides a more elegant solution to IO multiplexing than standard calls to poll or select because you can still write code in a style that looks like threads. The scheduler is doing the multiplexing for you behind the scenes.

About

Small user-space thread library for x86

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published