setMaxThreads(max_threads)
When Houdini/hython is started, it uses all available processors on
the machine for multi-threaded processing, unless overridden by the
-j
command line option.
This function allows dynamically adjusting this setting at run-time.
Note that this function may only be called from the main thread. If called from an expression that gets evaluated in a multi-threaded context, or during other processing, it will throw an exception.
Warning
The effectiveness of this function differs on different platforms. Prefer
using the -j
command line option setting the HOUDINI_MAXTHREADS
environment variable instead.
Warning
This function will have no effect if an CPU OpenCL driver is installed, and possibly other situations as well.
See also |