Go to the documentation of this file. 1 #ifndef SimTK_SimTKCOMMON_PARALLEL_EXECUTOR_H_
2 #define SimTK_SimTKCOMMON_PARALLEL_EXECUTOR_H_
33 class ParallelExecutor;
34 class ParallelExecutorImpl;
39 #ifndef SimTK_SIMTKCOMMON_DEFINING_PARALLEL_EXECUTOR
40 extern template class PIMPLHandle<ParallelExecutor, ParallelExecutorImpl>;
174 #endif // SimTK_SimTKCOMMON_PARALLEL_EXECUTOR_H_
static bool isWorkerThread()
Determine whether the thread invoking this method is a worker thread created by ParallelExecutor.
int getMaxThreads() const
Get the maximum number of thread contexts that the ParallelExecutor is currently allowed to use.
virtual ~Task()
Definition: ParallelExecutor.h:150
virtual void initialize()
This method is invoked once by each worker thread before the task is executed.
Definition: ParallelExecutor.h:161
static int getNumProcessors()
Get the total number of available processor cores (physical cores and hyperthreads on Intel architect...
Concrete subclasses of this abstract class represent tasks that can be executed by a ParallelExecutor...
Definition: ParallelExecutor.h:148
ParallelExecutor(int maxThreads)
Construct a ParallelExecutor.
This is a System that represents the dynamics of a particle moving along a smooth surface.
Definition: Assembler.h:37
#define SimTK_SimTKCOMMON_EXPORT
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:224
ParallelExecutor()
Construct a ParallelExecutor.
void execute(Task &task, int times)
Execute a parallel task.
virtual void finish()
This method is invoked once by each worker thread after all invocations of the task on that thread ar...
Definition: ParallelExecutor.h:168
This class is used for performing multithreaded computations.
Definition: ParallelExecutor.h:97
virtual void execute(int index)=0
This method defines the task to be performed.
ParallelExecutor * clone() const
Clone the ParallelExecutor.