Keeps track of the threads currently available to the physics engine.
Inheritance: IParallelLooper, IDisposable
Example #1
0
 internal WorkerThread(int index, ThreadTaskManager manager, Action threadStart)
 {
     this.manager        = manager;
     thread              = new Thread(ThreadExecutionLoop);
     thread.IsBackground = true;
     taskData            = new ConcurrentDeque <TaskEntry>();
     this.threadStart    = threadStart;
     UpdateIndex(index);
     thread.Start();
 }
Example #2
0
 internal WorkerThread(int index, ThreadTaskManager manager, Action <object> threadStart, object initializationInformation)
 {
     this.manager                   = manager;
     thread                         = new Thread(ThreadExecutionLoop);
     thread.IsBackground            = true;
     taskData                       = new ConcurrentDeque <TaskEntry>();
     this.threadStart               = threadStart;
     this.initializationInformation = initializationInformation;
     UpdateIndex(index);
     //#if WINDOWS
     //                ResourcePool.addThreadID(thread.ManagedThreadId);
     //#endif
     thread.Start();
 }
Example #3
0
            internal WorkerThread(int index, ThreadTaskManager manager, Action <object> threadStart, object initializationInformation)
            {
                this.manager     = manager;
                taskData         = new ConcurrentDeque <TaskEntry>();
                this.threadStart = threadStart;
                this.initializationInformation = initializationInformation;
                UpdateIndex(index);

#if WINRT
                Windows.System.Threading.ThreadPool.RunAsync(op => ThreadExecutionLoop(),
                                                             Windows.System.Threading.WorkItemPriority.Normal,
                                                             Windows.System.Threading.WorkItemOptions.TimeSliced);
#else
                var thread = new Thread(ThreadExecutionLoop);
                thread.IsBackground = true;
                //#if WINDOWS
                //                ResourcePool.addThreadID(thread.ManagedThreadId);
                //#endif
                thread.Start();
#endif
            }
 /// <summary>
 /// Constructs a new specialized thread manager
 /// that manages loops and tasks separately.
 /// </summary>
 public SpecializedThreadManager()
 {
     taskManager = new ThreadTaskManager();
     looper = new ParallelLooper();
 }
Example #5
0
 internal WorkerThread(int index, ThreadTaskManager manager, Action<object> threadStart, object initializationInformation)
 {
     this.manager = manager;
     thread = new Thread(ThreadExecutionLoop);
     thread.IsBackground = true;
     taskData = new ConcurrentDeque<TaskEntry>();
     this.threadStart = threadStart;
     this.initializationInformation = initializationInformation;
     UpdateIndex(index);
     //#if WINDOWS
     //                ResourcePool.addThreadID(thread.ManagedThreadId);
     //#endif
     thread.Start();
 }
 /// <summary>
 /// Constructs a new specialized thread manager
 /// that manages loops and tasks separately.
 /// </summary>
 public SpecializedThreadManager()
 {
     taskManager = new ThreadTaskManager();
     looper      = new ParallelLooper();
 }
Example #7
0
 /// <summary>
 /// Constructs the TPL thread manager.
 /// </summary>
 public ThreadManagerTPL()
 {
     TaskManager = new ThreadTaskManager();
 }
Example #8
0
 /// <summary>
 /// Constructs the TPL thread manager.
 /// </summary>
 public ThreadManagerTPL()
 {
     TaskManager = new ThreadTaskManager();
 }
 internal WorkerThread(int index, ThreadTaskManager manager, Action threadStart)
 {
     this.manager = manager;
     thread = new Thread(ThreadExecutionLoop);
     thread.IsBackground = true;
     taskData = new ConcurrentDeque<TaskEntry>();
     this.threadStart = threadStart;
     UpdateIndex(index);
     thread.Start();
 }