All Data Structures Files Functions Variables Typedefs Macros
ns_thrpool_config Struct Reference

#include <nunc-stans.h>

Data Fields

PRInt32 initial_threads
 
PRInt32 max_threads
 
PRUint32 stacksize
 
PRUint32 event_queue_size
 
PRUint32 work_queue_size
 
void(* log_fct )(int, const char *, va_list)
 
void(* log_start_fct )()
 
void(* log_close_fct )()
 
void *(* malloc_fct )(size_t)
 
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.initial_threads = 16;
nsconfig.malloc_fct = mymalloc;
...
rc = ns_thrpool_new(&nsconfig);
See Also
ns_thrpool_config_init, ns_thrpool_new

Field Documentation

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

calloc() replacement

PRUint32 ns_thrpool_config::event_queue_size

Size of the event queue

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

free() replacement

PRInt32 ns_thrpool_config::initial_threads

Number of thread pool threads to start with

void(* ns_thrpool_config::log_close_fct)()

Function to call to shutdown the logging system

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

Provide a function that works like vsyslog

void(* ns_thrpool_config::log_start_fct)()

Function to call to initialize the logging system

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

malloc() replacement

PRInt32 ns_thrpool_config::max_threads

Do not grow the thread pool greater than this size

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

realloc() replacement

PRUint32 ns_thrpool_config::stacksize

Thread stack size

PRUint32 ns_thrpool_config::work_queue_size

Size of the work queue