Class MTJobQueue
Multi-threaded job queue. A job queue allows a fixed number of jobs to be executed in parallel, typically one per CPU core. If the number of jobs exceeds the maximum parallelism, the jobs are queued until a slot becomes available. This class is at the core of TuringTrader's optimizer, but also used for parallel data updating.
Inherited Members
Namespace: TuringTrader.Simulator
Assembly: TuringTrader.Simulator.dll
Syntax
public class MTJobQueue
Constructors
| Edit this page View SourceMTJobQueue(int)
Create and initialize new job queue.
Declaration
public MTJobQueue(int maxNumberOfThreads = 0)
Parameters
Type | Name | Description |
---|---|---|
int | maxNumberOfThreads | maximum number of threads. If zero, the number of logical cpu cores is used. |
Properties
| Edit this page View SourceSTA
Set child threads to STA. This may be required for threads interacting w/ GUI elements.
Declaration
public bool STA { get; set; }
Property Value
Type | Description |
---|---|
bool |
Methods
| Edit this page View SourceQueueJob(Action)
Add job to queue.
Declaration
public void QueueJob(Action job)
Parameters
Type | Name | Description |
---|---|---|
Action | job | job action |
WaitForCompletion()
Wait for completion of all currently queued jobs.
Declaration
public void WaitForCompletion()