Welcome to TinyFiber’s documentation!

Indices and tables

Reference documentation

struct TfbJobDeclaration
#include <tinyfiber.h>

Public Members

void (*func)(void*)
void *user_data
TfbWaitHandle *wait_handle
struct TfbWaitHandle
#include <tinyfiber.h>

Public Members

void *_fiber
int64_t _counter
void *_lock
file tinyfiber.h
#include <stdint.h>#include <stddef.h>

Typedefs

typedef struct TfbContext TfbContext

Functions

int tfb_init_ext(TfbContext **fiber_system, 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);

Return

0 if successful, otherwise the error code.

See

tfb_init()

See

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.

int tfb_init()
int tfb_free_ext(TfbContext **fiber_system)
int tfb_free()
int tfb_add_jobdecl_ext(TfbContext *fiber_system, TfbJobDeclaration *job_declaration)
int tfb_add_jobdecl(TfbJobDeclaration *job_declaration)
int tfb_add_jobdecls_ext(TfbContext *fiber_system, TfbJobDeclaration jobs[], int64_t elements)
int tfb_add_jobdecls(TfbJobDeclaration jobs[], int64_t elements)
int tfb_add_job_ext(TfbContext *fiber_system, void (*func)(void*), void *user_data, TfbWaitHandle *wh, )
int tfb_add_job(void (*func)(void*), void *user_data, TfbWaitHandle *wh, )
int tfb_await_ext(TfbContext *fiber_system, TfbWaitHandle *wait_handle)
int tfb_await(TfbWaitHandle *wait_handle)

Variables

const int TFB_ALL_CORES = 0
TfbContext *const TFB_MY_CONTEXT = NULL
dir /home/docs/checkouts/readthedocs.org/user_builds/tinyfiber/checkouts/latest/src