C# Класс BEPUphysics.Threading.ThreadManagerTPL

Uses the .NET Task Parallel library to manage the engine's threads.
Наследование: IThreadManager
Показать файл Открыть проект

Открытые методы

Метод Описание
AddThread ( ) : void

Notifies the thread manager that it should use another thread.

AddThread ( Action initialization, object initializationInformation ) : void

Notifies the thread manager that it should use another thread.

Dispose ( ) : void

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

EnqueueTask ( Action taskBody, object taskInformation ) : void

Enqueues a task to the thread manager. This should be safe to call from multiple threads and from other tasks.

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

Notifies the thread manager that it should decrease the number of threads used.

ThreadManagerTPL ( ) : System

Constructs the TPL thread manager.

WaitForTaskCompletion ( ) : void

Waits until all tasks enqueued using enqueueTask are complete.

Описание методов

AddThread() публичный метод

Notifies the thread manager that it should use another thread.
public AddThread ( ) : void
Результат void

AddThread() публичный метод

Notifies the thread manager that it should use another thread.
public AddThread ( Action initialization, object initializationInformation ) : void
initialization Action Function to use to initialize the thread.
initializationInformation object Information to provide to the initializer.
Результат void

Dispose() публичный метод

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public Dispose ( ) : void
Результат void

EnqueueTask() публичный метод

Enqueues a task to the thread manager. This should be safe to call from multiple threads and from other tasks.
public EnqueueTask ( Action taskBody, object taskInformation ) : void
taskBody Action Method to run.
taskInformation object Data to give to the task.
Результат void

ForLoop() публичный метод

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.
Результат void

RemoveThread() публичный метод

Notifies the thread manager that it should decrease the number of threads used.
public RemoveThread ( ) : void
Результат void

ThreadManagerTPL() публичный метод

Constructs the TPL thread manager.
public ThreadManagerTPL ( ) : System
Результат System

WaitForTaskCompletion() публичный метод

Waits until all tasks enqueued using enqueueTask are complete.
public WaitForTaskCompletion ( ) : void
Результат void