V_limitThreadsPerFunc
FunctionLimit the number of threads which each call of an OptiVec function may use for itself in the multi-thread libraries
Syntax C/C++#include <VecLib.h>
int V_limitThreadsPerFunc( unsigned nMaxThreads );
Pascal/Delphiuses VecLib;
function V_limitThreadsPerFunc( nMaxThreads:UInt ): IntBool;
DescriptionAs described for V_initMT, on computers with many processor cores (from about 8 or 16 on), one might wish to limit the number of threads which each called OptiVec function may claim for itself. This is especially true, if an application generates several worker threads, and if each (or several) of them calls OptiVec functions. In the interest of a well-balanced use of the processor capacities, call V_limitThreadsPerFunc to set the number of threads available to each call of an OptiVec function. Be, however, rather generous: For example, with 16 cores and 4 application threads, give the OptiVec functions not only 16/4=4, but rather 8 threads each. The OS will take care of optimum scheduling of all these threads.

V_limitThreadsPerFunc should be called immediately after V_initMT. The number of threads thus set will be valid for all calls to OptiVec functions out of all application threads. In principle, it is possible to call V_limitThreadsPerFunc again to modify that number at some point in the application. Note, however, that V_limitThreadsPerFunc is not thread-safe, and it would be a matter of chance, which function calls would employ the "new" value and for which the "old" one would still be applied.

Return valuealways FALSE(0)
See alsoV_initMT,   V_closeMT, Kap. 1.1.2.

VectorLib Table of Contents  OptiVec home