MtxForLoop::ThreadedForLoop Function

Overload List

#SignatureDescription
1bool ThreadedForLoop(int IterMin, int IterMax, TForLoopRangeEvent MyLoop, TMtxForLoop *Threads, const DewArray<tObject *> &Context);Call this function to initiate threaded for-loop.
2bool ThreadedForLoop(int IterMin, int IterMax, TForLoopEvent MyLoop, TMtxForLoop *Threads, const DewArray<tObject *> &Context);Call this function to initiate threaded for-loop.

Overload 1: bool ThreadedForLoop(int IterMin, int IterMax, TForLoopRangeEvent MyLoop, TMtxForLoop *Threads, const DewArray<tObject *> &Context);

Call this function to initiate threaded for-loop.

#NameTypeDescription
1IterMinint
2IterMaxint
3MyLoopTForLoopRangeEvent
4ThreadsTMtxForLoop *
5Contextconst DewArray<tObject *> &
Remarks:

The MyLoop method pointer must be a method. This is the function that will be called once by each thread. Threads parameter requires a TMtxForLoop object and the Context parameter can be used to pass any parameters to the threaded function. The threading engine will attempt to equaly partition the job between available threads assuming constant computational load for each Iteration in the range from IterMin to IterMax. However, further vectorization is possible within each threaded function call.

Use MtxVec.DoForLoop to take advantage of super-conductive MtxVec object cache. Calling ThreadedForLoop in parallel from multiple threads will not work. The call is to be protected with a critical section or otherwise.

Declared in Dew::Math::Units::MtxForLoop · Dew.Math/Units.MtxForLoop.h · Cross-compiler

Overload 2: bool ThreadedForLoop(int IterMin, int IterMax, TForLoopEvent MyLoop, TMtxForLoop *Threads, const DewArray<tObject *> &Context);

Call this function to initiate threaded for-loop.

#NameTypeDescription
1IterMinint
2IterMaxint
3MyLoopTForLoopEvent
4ThreadsTMtxForLoop *
5Contextconst DewArray<tObject *> &
Remarks:

The MyLoop method pointer must be a method. This is the function that will be called (IterMax - IterMin + 1) times. Threads parameter requires a TMtxForLoop object and Context can be used to pass any parameters to the threaded function. Computational load for each Iteration in the range from IterMin to IterMax is allowed to vary (possibly by a lot). Further vectorization within each threaded function call is not possible across the working Iteration range.

Use MtxVec.DoForLoop to take advantage of super-conductive MtxVec object cache. Calling ThreadedForLoop in parallel from multiple threads will not work. The call is to be protected with a critical section or otherwise.

Declared in Dew::Math::Units::MtxForLoop · Dew.Math/Units.MtxForLoop.h · Cross-compiler