thrGetNThread

Determine the number of threads to use

Description:

This function returns the number of worker threads to use when dividing a task up between multiple threads. Note, a value of " 1" means one worker thread in addition to the required manager thread that co-ordinates the workers (i.e. the main thread in which the application is started). The default value is the number of CPU cores available, but this can be over-ridden by setting the environment variable specified by the " env" argument to some other value. A value fo zero is returned if the app should run in a single thread without any worker threads.

Invocation

int thrGetNThread( const char env, int status );

Arguments

env = const char (Given)
Pointer to the name of an environment variable which should be used to get the number of threads (e.g. " SMURF_THREADS" ).
status = int (Given and Returned)
Pointer to inherited status.

Returned Value

The number of threads to use. A value of 1 is returned if an error
occurs. A value of zero indicates that the application should run
in a single thread.