Template Function sequant::parallel_do

Function Documentation

template<typename Lambda>
void sequant::parallel_do(Lambda &&lambda)

Fires off nthreads instances of lambda in parallel, each in its own thread (thus nthreads-1 std::thread objects are created), where nthreads is the value returned by get_num_threads() .

See also

get_num_threads()

Template Parameters:

Lambda – a function type for which Lambda(int) is valid

Parameters:

lambda – the function object to execute, each will be invoked as lambda(thread_id) where thread_id is an integer in [0,nthreads) .