NAME
cthread_configure - Set C thread configuration parameters.
LIBRARY
C Threads Library (libcthreads.a)
SYNOPSIS
#include <cthread.h>
typedef struct configuration {
int stack_size;
int memory_exponent;
int threads_per_proc;
} *configuration_t;
typedef enum {GET_CONFIG, PUT_CONFIG} config_action;
RESULT cthread_configure( configuration_t conf,
config_action action);
PARAMETERS
conf A pointer to a structure from which configuration
information will be read or into which it will be
stored.
action This controls whether or not the configuration is set
or read by the call. Valid values are GET_CONFIG and
PUT_CONFIG.
DESCRIPTION
The cthread_configure() call reads/updates the configuration
of the thread library. If the action parameter is
GET_CONFIG, the current cthreads configuration is stored
into the specified structure. If the action parameter is
PUT_CONFIG, the current cthreads configuration is set based
on the values in the specified configuration structure. The
parameters which can be configured are:
stack_size
specifies the size of the stack allocated to each
thread. The default setting is specified with
DEFAULT_STACK. The value of the default varies
among the cthread implementations. See
cthread_parse_args(3) for the current values.
There is no mechanism for specifying larger or
smaller stacks on a thread-by-thread basis.
memory_exponent
specifies the amount of shared memory to be avail-
able to the application. The implementation will
provide at least 2^memory_exponent bytes. The
default value is specified with DEFAULT_MEM. The
value of the default varies among the cthread
implementations. See cthread_parse_args(3) for
the current values.
threads_per_proc
specifies the default number of the threads which
are going to be preallocated per processor. A
number of threads is preallocated with the ini-
tialization of the library. Note that since
their stack space is preallocated also making this
value large affects the memory requirements of
your application. The default value is specified
DEFAULT_THREADS. The value of the default varies
among cthread implementations. See
cthread_parse_args(3) for the current values.
The cthread_configure call with PUT_CONFIG action can be
issued only before the cthread_init() call.
When a PUT_CONFIG action is issued all configuration values
are changed. If you want to change only some of them, ini-
tialize the rest of them with DEFAULT_STACK, DEFAULT_MEM or
DEFAULT_THREADS as appropriate.
SEE ALSO
cthread_intro(3), cthread_parse_args(3), cthread_init(3)
AUTHOR
Cthreads was written and maintained by many people.
This man page written by Greg Eisenhauer.