C# 클래스 BEPUphysics.Threading.SimpleThreadManager

Manages the engine's threads.
Uses a simple round-robin threadpool. It is recommended that other thread managers are used instead of this one; it is kept for compatability and a fallback in case of problems.
상속: IThreadManager
파일 보기 프로젝트 열기: Indiefreaks/igf 1 사용 예제들

공개 메소드들

메소드 설명
AddThread ( ) : void

Adds a thread to the manager.

AddThread ( Action initialization, object initializationInformation ) : void

Adds a thread to the manager.

Dispose ( ) : void

Releases threads and resources used by the thread manager.

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 and blocks until success.

ShutDown ( ) : void

Tells every thread in the thread manager to shut down and waits until completion.

SimpleThreadManager ( ) : System

Constructs the thread manager.

WaitForTaskCompletion ( ) : void

Blocks the current thread until all tasks have been completed.

비공개 메소드들

메소드 설명
DoLoopSection ( object o ) : void
RemakeLoopSections ( ) : void

메소드 상세

AddThread() 공개 메소드

Adds a thread to the manager.
public AddThread ( ) : void
리턴 void

AddThread() 공개 메소드

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.
리턴 void

Dispose() 공개 메소드

Releases threads and resources used by the thread manager.
public Dispose ( ) : void
리턴 void

EnqueueTask() 공개 메소드

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.
리턴 void

EnqueueTaskSequentially() 공개 메소드

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.
리턴 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 thread and blocks until success.
public RemoveThread ( ) : void
리턴 void

ShutDown() 공개 메소드

Tells every thread in the thread manager to shut down and waits until completion.
public ShutDown ( ) : void
리턴 void

SimpleThreadManager() 공개 메소드

Constructs the thread manager.
public SimpleThreadManager ( ) : System
리턴 System

WaitForTaskCompletion() 공개 메소드

Blocks the current thread until all tasks have been completed.
public WaitForTaskCompletion ( ) : void
리턴 void