MtxVec VCL
|
Block granularity for TThreadingMode.tmForLoop.
Use this property to address asymetric multi-processing.
By default the for-loop range will be split equally among all available threads. Within each thread a further split of the assigned indexed range can be specified with BlockGranularity. When this parameter is 1, each thread will call the compute event/callback once, when it is 2, then twice, etc... of course with the adjusted index parameters in the callback event.
This is usefull when:
If some threads will finish faster than others, they can start to work on other unfinished sections without waiting for the slowest thread to finish. The drawback is that some threads may never get to be launched at all, because the job will be finished, before each thread will be able to get their piece of it and other threads will process multiple pieces. Do not assume that all "ThreadIndex" values in the callback event will be used, when BlockGranularity is specified to be more than 1.
An alternative solution to this parameter is to specify ThreadCount, which is 2x, 4x, etc... bigger than CPU core count. Increasing ThreadCount beyond CPU core count however is not recommended. Running more threads will also put additional pressure on any shared resources protected with critical sections like memory managers and MtxVec object cache.
This parameter applies only to:
Copyright (c) 1999-2025 by Dew Research. All rights reserved.
|
What do you think about this topic? Send feedback!
|