Scroll to navigation

ns_thrpool_config(3) dirsrv ns_thrpool_config(3)

NAME

ns_thrpool_config -

SYNOPSIS

#include <nunc-stans.h>

Data Fields


size_t max_threads
size_t 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;
ns_thrpool_config_init(&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

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

calloc() replacement

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

free() replacement

void(* ns_thrpool_config::log_close_fct)(void)

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)(void)

Function to call to initialize the logging system

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

malloc() replacement

size_t ns_thrpool_config::max_threads

Do not grow the thread pool greater than this size

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

posix_memalign() replacement. Note the argument order!

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

realloc() replacement

size_t ns_thrpool_config::stacksize

Thread stack size

Author

Generated automatically by Doxygen for dirsrv from the source code.

Tue Jun 4 2024 Version 1.3.11.12