Skip to content

livankrekh/libft_thpool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

libft_thpool

Simple C multithread project. Library for manage pthread pool

Compile library

> make

Result: libft_thpool.a

Library functions

Function to create a pool struct named t_tp_thread

int count - number of threads

char flag - TP_ON_EXEC (execute pool on new task adding) or TP_ON_START (execution on pool creating)

t_tp_thread *tp_create(int count, char flag);

Function to execute task (function f) on created pthread pool

t_tp_thread *queue - pthread pool

void *(*f)(void *) - task, that need to execute on pool

void *data - argument for void *(*f)(void *) function

int tp_exec_queue_add(t_tp_thread *queue, void *(*f)(void *), void *data);

Function for waiting end of execution of pthread pool

t_tp_thread *queue - pthread pool

int tp_wait_for_queue(t_tp_thread *queue);

Function for get number of processor cores

int tp_get_nbr_proc(void);

About

Library to create a pool of processes in C.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published