#include <ParallelExecutor.h>
Public Member Functions | |
virtual | ~Task () |
virtual void | execute (int index)=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. |
virtual ~Task | ( | ) | [inline, virtual] |
virtual void execute | ( | int | index | ) | [pure virtual] |
virtual void 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 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.