Task Class Reference

Concrete subclasses of this abstract class represent tasks that can be executed by a ParallelExecutor. More...

#include <ParallelExecutor.h>

List of all members.

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.

Detailed Description

Concrete subclasses of this abstract class represent tasks that can be executed by a ParallelExecutor.


Constructor & Destructor Documentation

virtual ~Task (  )  [inline, virtual]

Member Function Documentation

virtual void execute ( int  index  )  [pure virtual]

This method defines the task to be performed.

When the Task is passed to a ParallelExecutor's execute() method, this method will be called in parallel the specified number of times.

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.

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.


The documentation for this class was generated from the following file:

Generated on Wed Dec 30 11:05:27 2009 for SimTKcore by  doxygen 1.6.1