Template Function quickpool::parallel_for

Function Documentation

template<typename UnaryFunction>
inline void quickpool::parallel_for(int begin, int end, UnaryFunction &&f)

computes an index-based parallel for loop.

Waits until all tasks have finished, unless called from a thread that didn’t create the pool. If this is taken into account, parallel loops can be nested.

Parameters
  • begin – first index of the loop.

  • end – the loop runs in the range [begin, end).

  • f – a function taking int argument (the ‘loop body’).