HyperspaceExplorer 0.7.1
|
Does the work of running a function concurrently on a random access container. More...
#include <MultithreadingPrivate.h>
Static Public Member Functions | |
static std::vector< Kernel * > | generateKernels (const RandomAccessContainer &container, RandomAccessContainer &output, Function function, unsigned tasks_per_processor) |
static void | startTasks (const std::vector< Kernel * > &tasks) |
static void | waitForTasks (const std::vector< Kernel * > &tasks) |
Protected Member Functions | |
void | run () |
Private Member Functions | |
Kernel (const RandomAccessContainer &container, unsigned index_start, unsigned index_end, Function function, RandomAccessContainer &output) | |
Private Attributes | |
const RandomAccessContainer & | container_ |
unsigned | index_start_ |
unsigned | index_end_ |
Function | function_ |
RandomAccessContainer & | output_ |
Does the work of running a function concurrently on a random access container.
RandomAccessContainer | Type of the container on which the operation is run. Must support operator[]() . |
Function | Type of the operation that is run on every element of the container . Either a function with the signature T function(const T &argument)
operator()() has that signature. |
Adapt to the "correct" version of using QThread; see http://labs.qt.nokia.com/2010/06/17/youre-doing-it-wrong/ and http://mayaposch.wordpress.com/2011/11/01/how-to-really-truly-use-qthreads-the-full-explanation/
possibility to transparently use different backends (QThread and std::thread)