void
qt_loop (const size_t start, const size_t stop, const qt_loop_f func,
void *argptr);
void
qt_loop_step (const size_t start, const size_t stop, const size_t stride,
const qt_loop_f func, void *argptr);
This function can be thought of as akin to the following code:
unsigned int i;
for (i = start; i < stop; i += stride) {
func(NULL, i, i+1, argptr);
}
A qthread is spawned for every iteration of the above loop. Thus, if start is 50, stop is 100, and stride is 1, there will be 50 qthreads. But, if start is 50, stop is 100, and stride is 2, there will be 25 qthreads.
The func argument must be a function pointer with a qt_loop_f prototype, such as:
aligned_t func (size_t start, size_t stop, void *arg);
The return value of this function is ignored. However, qt_loop() will not return until all of the qthreads it spawns have returned.