|
Simbody
3.4 (development)
|
Concrete subclasses of this abstract class represent tasks that can be executed by a Parallel2DExecutor. More...
#include <Parallel2DExecutor.h>
Public Member Functions | |
| virtual | ~Task () |
| virtual void | execute (int i, int j)=0 |
| This method defines the task to be performed. | |
| virtual void | initialize () |
| This method is invoked once by each worker thread before the task is executed. | |
| virtual void | finish () |
| This method is invoked once by each worker thread after all invocations of the task on that thread are complete. | |
Concrete subclasses of this abstract class represent tasks that can be executed by a Parallel2DExecutor.
| virtual SimTK::Parallel2DExecutor::Task::~Task | ( | ) | [inline, virtual] |
| virtual void SimTK::Parallel2DExecutor::Task::execute | ( | int | i, |
| int | j | ||
| ) | [pure virtual] |
This method defines the task to be performed.
When the Task is passed to a Parallel2DExecutor's execute() method, this method will be called in parallel for each allowed value of i and j.
| virtual void SimTK::Parallel2DExecutor::Task::initialize | ( | ) | [inline, virtual] |
This method is invoked once by each worker thread before the task is executed.
This can be used to initialize thread-local storage.
| virtual void SimTK::Parallel2DExecutor::Task::finish | ( | ) | [inline, virtual] |
This method is invoked once by each worker thread after all invocations of the task on that thread are complete.
This can be used to clean up thread-local storage, or to record per-thread results. All calls to this method are synchronized, so it can safely write to global variables without danger of interference between worker threads.