NAME
mthr_config - change the configuration of the mthreads package

mthr_configv - change the configuration by commandline options

SYNOPSIS
#include <mthr_config.h>

int mthr_config(int what, int value);

void mthr_configv(int &argc, char *argv[]);

DESCRIPTION
When the userlevel package is initialized and started, default configuration values for various parts of the package are used. These values ensure correct behaviour of all the package's parts. Nevertheless, it may be necessary and/or advantageous to manually adjust some of these values to ensure better performance. Improvements can be possible due to recent changes in the machine configuration or to special requirements of the application.

There are two different possibilities to change the configuration parameters. mthr_config directly changes one parameter to an application specific value, whereas with mthr_configv it is possible to change values of a compiled program by specifying commandline options.

Both possibilities may only be used before the call to mthr_startup(3) as the parameters are needed by this function. Changing the configuration values after starting the package may confuse certain functions and crash the application!

mthr_config changes the value of the parameter what to the new value offered by value. Usually macros out of mthr_config.h should be used for what to avoid problems due to changes in the mthreads library. The following parameters are currently supported:

The second possibility to change the configuration parameter is to use the mthr_configv call. This function gets the argument counter and argument vector from main(), eliminates all options known to him from the argument vector and adjusts the value of the argument counter.

Each known option starts with the prefix -m_ followed by a short abbreviation and a numerical value. The program can be started with the mthreads options and its own options in arbitrary order. The example below starts the program check_opt with two mthreads options and one application specific option:

   check_opt -m_sbb 40 -my_opt1 -m_cpus 4

There are the same configurable parameters as with the mthr_config call:

SEE ALSO
mthreads(3)