ns_thrpool_config Struct Reference

#include <nunc-stans.h>

Data Fields

PRInt32 max_threads
PRUint32 stacksize
void(* log_fct )(int, const char *, va_list)
void(* log_start_fct )(void)
void(* log_close_fct )(void)
void *(* malloc_fct )(size_t)
void *(* memalign_fct )(size_t size, size_t alignment)
void *(* calloc_fct )(size_t, size_t)
void *(* realloc_fct )(void *, size_t)
void(* free_fct )(void *)

Detailed Description

Used to configure the thread pool

This is the argument to ns_thrpool_new(). This is used to set all of the configuration parameters for the thread pool.

This must be initialized using ns_thrpool_config_init(). This will initialize the fields to their default values. Use like this:

struct ns_thrpool_config nsconfig;
nsconfig.max_threads = 16;
nsconfig.malloc_fct = mymalloc;
rc = ns_thrpool_new(&nsconfig);
See also
ns_thrpool_config_init, ns_thrpool_new

Field Documentation

§ calloc_fct

void*(* ns_thrpool_config::calloc_fct) (size_t, size_t)

calloc() replacement

§ free_fct

void(* ns_thrpool_config::free_fct) (void *)

free() replacement

§ log_close_fct

void(* ns_thrpool_config::log_close_fct) (void)

Function to call to shutdown the logging system

§ log_fct

void(* ns_thrpool_config::log_fct) (int, const char *, va_list)

Provide a function that works like vsyslog

§ log_start_fct

void(* ns_thrpool_config::log_start_fct) (void)

Function to call to initialize the logging system

§ malloc_fct

void*(* ns_thrpool_config::malloc_fct) (size_t)

malloc() replacement

§ max_threads

PRInt32 ns_thrpool_config::max_threads

Do not grow the thread pool greater than this size

§ memalign_fct

void*(* ns_thrpool_config::memalign_fct) (size_t size, size_t alignment)

posix_memalign() replacement. Note the argument order!

§ realloc_fct

void*(* ns_thrpool_config::realloc_fct) (void *, size_t)

realloc() replacement

§ stacksize

PRUint32 ns_thrpool_config::stacksize

Thread stack size