Simple tools for multi threading / objects in plain C Snapshot
Classes | Typedefs | Functions
tpool.h File Reference
#include <tutils/tqueue.h>
#include <tutils/cbarrier.h>

Go to the source code of this file.

Classes

struct  tagRUNNABLE
struct  tagTHREADPOOL

Typedefs

typedef void(* RUNNABLE_HANDLER )(struct tagRUNNABLE *request)
typedef struct tagRUNNABLE RUNNABLE
typedef struct tagTHREADPOOL THREADPOOL

Functions

void RUNNABLE_init (RUNNABLE *runnable, RUNNABLE_HANDLER handler, RUNNABLE_HANDLER free_request)
 constructs a RUNNABLE instance
void RUNNABLE_free (RUNNABLE *runnable)
 free a RUNNABLE instance
THREADPOOLTHREADPOOL_init (RUNNABLE_HANDLER process_result, int queue_size, int num_threads, int stack_size_kb)
 constructs a thread pool and starts it.
void THREADPOOL_close (THREADPOOL *pool)
int THREADPOOL_send_block_on_queue_full (THREADPOOL *pool, RUNNABLE *request)
 posts a work request to the pool; blocks if request queue limit is reached
int THREADPOOL_send_fail_on_queue_full (THREADPOOL *pool, RUNNABLE *request)
 posts a work request to the pool; blocks if request queue limit is reached

Typedef Documentation

typedef void(* RUNNABLE_HANDLER)(struct tagRUNNABLE *request)

Definition at line 12 of file tpool.h.