C# Class BEPUphysics.Threading.ThreadTaskManager

Keeps track of the threads currently available to the physics engine.
Inheritance: IParallelLooper, IDisposable
Afficher le fichier Open project: Indiefreaks/igf Class Usage Examples

Méthodes publiques

Méthode Description
AddThread ( ) : void

Adds a thread to the manager.

AddThread ( Action initialization, object initializationInformation ) : void

Adds a thread to the manager.

Dispose ( ) : void

Releases resources used by the object.

EnqueueTask ( Action task, object taskInformation ) : void

Gives the thread manager a new task to run.

EnqueueTaskSequentially ( Action task, object taskInformation ) : void

Enqueues a task. This method also does not perform any locking; it should only be called when all worker threads of the thread pool are idle and all calls to this method are from the same thread.

ForLoop ( int startIndex, int endIndex, Action loopBody ) : void

Loops from the starting index (inclusive) to the ending index (exclusive), calling the loopBody at each iteration. The forLoop function will not return until all iterations are complete. This is meant to be used in a 'fork-join' model; only a single thread should be running a forLoop at any time.

RemoveThread ( ) : void

Removes a thread from the manager.

ThreadTaskManager ( ) : System

Constructs a new thread task manager.

WaitForTaskCompletion ( ) : void

Blocks the current thread until all tasks have been completed.

Private Methods

Méthode Description
DoLoopSection ( object o ) : void
RemakeLoopSections ( ) : void

Method Details

AddThread() public méthode

Adds a thread to the manager.
public AddThread ( ) : void
Résultat void

AddThread() public méthode

Adds a thread to the manager.
public AddThread ( Action initialization, object initializationInformation ) : void
initialization Action A function to run to perform any initialization on the new thread.
initializationInformation object Data to give the ParameterizedThreadStart for initialization.
Résultat void

Dispose() public méthode

Releases resources used by the object.
public Dispose ( ) : void
Résultat void

EnqueueTask() public méthode

Gives the thread manager a new task to run.
public EnqueueTask ( Action task, object taskInformation ) : void
task Action Task to run.
taskInformation object Information to be used by the task.
Résultat void

EnqueueTaskSequentially() public méthode

Enqueues a task. This method also does not perform any locking; it should only be called when all worker threads of the thread pool are idle and all calls to this method are from the same thread.
public EnqueueTaskSequentially ( Action task, object taskInformation ) : void
task Action Task to enqueue.
taskInformation object Information for the task.
Résultat void

ForLoop() public méthode

Loops from the starting index (inclusive) to the ending index (exclusive), calling the loopBody at each iteration. The forLoop function will not return until all iterations are complete. This is meant to be used in a 'fork-join' model; only a single thread should be running a forLoop at any time.
public ForLoop ( int startIndex, int endIndex, Action loopBody ) : void
startIndex int Inclusive starting index.
endIndex int Exclusive ending index.
loopBody Action Function that handles an individual iteration of the loop.
Résultat void

RemoveThread() public méthode

Removes a thread from the manager.
public RemoveThread ( ) : void
Résultat void

ThreadTaskManager() public méthode

Constructs a new thread task manager.
public ThreadTaskManager ( ) : System
Résultat System

WaitForTaskCompletion() public méthode

Blocks the current thread until all tasks have been completed.
public WaitForTaskCompletion ( ) : void
Résultat void