Welcome to TinyFiber’s documentation!¶
Indices and tables¶
Reference documentation¶
-
struct TfbJobDeclaration¶
- #include <tinyfiber.h>
-
struct TfbWaitHandle¶
- #include <tinyfiber.h>
- file tinyfiber.h
- #include <stdint.h>#include <stddef.h>#include <atomic>#include <mutex>#include <optional>#include <ucontext.h>
Typedefs
-
typedef struct TfbContext TfbContext¶
Functions
-
int tfb_init_ext(int max_threads)¶
Creates a new fiber system context.
TfbContext* fiber_system = NULL; tfb_init_ext(&fiber_system, TFB_ALL_CORES); tfb_free_ext&fiber_system);
See also
See also
rfb_free_ext()
- Parameters
fiber_system – is your in-out pointer to a TfbContext pointer. Initialize to NULL before use.
max_threads – descibes how many working threads your fiber system should have.
- Returns
0 if successful, otherwise the error code.
-
inline int tfb_init()¶
-
int tfb_free()¶
-
int tfb_add_jobdecl(TfbJobDeclaration *job_declaration)¶
-
int tfb_add_jobdecls(TfbJobDeclaration jobs[], int64_t elements)¶
-
inline int tfb_add_job(void (*func)(void*), void *user_data, TfbWaitHandle *wh)¶
-
int tfb_await(TfbWaitHandle *wait_handle)¶
-
int64_t tfb_thread_id()¶
Variables
-
const int TFB_ALL_CORES = 0¶
-
typedef struct TfbContext TfbContext¶
- dir /home/docs/checkouts/readthedocs.org/user_builds/tinyfiber/checkouts/latest/src