ModErn Text Analysis
META Enumerates Textual Applications
|
Implementation of a thread pool and a parallel for loop. More...
Classes | |
class | thread_pool |
Represents a collection of a fixed number of threads, which tasks can be added to. More... | |
Functions | |
template<class Iterator , class Function > | |
void | parallel_for (Iterator begin, Iterator end, Function func) |
Runs the given function on the range denoted by begin and end in parallel. More... | |
template<class Iterator , class Function > | |
void | parallel_for (Iterator begin, Iterator end, thread_pool &pool, Function func) |
Runs the given function on the range denoted by begin and end in parallel. More... | |
Implementation of a thread pool and a parallel for loop.
void meta::parallel::parallel_for | ( | Iterator | begin, |
Iterator | end, | ||
Function | func | ||
) |
Runs the given function on the range denoted by begin and end in parallel.
begin | The first element to operate on |
end | One past the last element to operate on |
func | The function to perform on each element |
void meta::parallel::parallel_for | ( | Iterator | begin, |
Iterator | end, | ||
thread_pool & | pool, | ||
Function | func | ||
) |
Runs the given function on the range denoted by begin and end in parallel.
begin | The first element to operate on |
end | One past the last element to operate on |
pool | The thread pool to use |
func | The function to perform on each element |