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

Manages the engine's threads.
Separates the management of ThreadTasks and loops into specialized systems. Should have generally higher performance than the SimpleThreadManager.
Наследование: IParallelLooper
Показать файл Открыть проект Примеры использования класса

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

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

Adds a new worker thread to the engine.

AddThread ( Action initialization, object initializationInformation ) : void

Adds a new worker thread to the engine.

Dispose ( ) : void

Releases resources used by the object.

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

Removes a worker thread from the engine.

SpecializedThreadManager ( ) : System

Constructs a new specialized thread manager that manages loops and tasks separately.

WaitForTaskCompletion ( ) : void

Waits until all tasks enqueued using enqueueTask are complete.

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

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

Adds a new worker thread to the engine.
public AddThread ( ) : void
Результат void

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

Adds a new worker thread to the engine.
public AddThread ( Action initialization, object initializationInformation ) : void
initialization Action Function that each of the new threads will call before entering its work loop. Note that this type of thread manager spawns two worker threads for each given thread; /// the initializer will run twice.
initializationInformation object Data to give the initializer.
Результат void

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

Releases resources used by the object.
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() публичный метод

Removes a worker thread from the engine.
public RemoveThread ( ) : void
Результат void

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

Constructs a new specialized thread manager that manages loops and tasks separately.
public SpecializedThreadManager ( ) : System
Результат System

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

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