Product SiteDocumentation Site


tc_thread_pool_new, tc_thread_pool_wait — libtcr thread bundle functions


#include <tc/threaded_cr.h>

void tc_thread_pool_new(struct tc_thread_pool *threads, void (*func)(void *), void *data, char* name, int excess);

enum tc_rv tc_thread_pool_wait(struct tc_thread_pool *threads);


tc_thread_pool_new() creates a new user space thread on each system level thread. Data gets passed to func which is called in each of the created threads. The string passed as name should contain the "%d" sequence. It gets replaced by consecutive numbers. If excess is greater than 0 than excess additional number of threads are created. If excess is less than 0, that number less than number of system level worker threads are created in the pools of user space threads.
tc_thread_pool_wait() waits for the termination of all threads of the thread pool threads.


Philipp Reisner