You are here: Symbol Reference > MtxForLoop Namespace > Classes > TMtxForLoop Class > public > TMtxForLoop.CombinedLoopCount Method
MtxVec VCL
ContentsIndex
PreviousUpNext
TMtxForLoop.CombinedLoopCount Method

Returns combined loop iteration count to determine the progress of the computation.

Pascal
function CombinedLoopCount: integer;

When processing a range loop (threaded function has min and max parameters) it is the users responsability to update Thread.LoopIndex variable, if this indicator is required. Example: 

IntInterlockedIncrement(Thread.LoopIndex); 

This is because the actual loop runs within the users code. This function will return the count of all local thread iterations. The user is not allowed to increase Thread.LoopIndex 

In case of a while-loop or a for-loop without range the function will return combined number of iterations performed by all threads from the start of computation. The user is not allowed to increase Thread.LoopIndex

Copyright (c) 1999-2024 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!