Esempio n. 1
0
 /// <summary>
 /// Initialises a new instance of the JobScheduler class.
 /// </summary>
 /// <param name="threadCount">The number of threads to spawn.</param>
 public JobScheduler(int threadCount)
 {
     this.masterQueue = new MasterJobQueue();
     this.masterQueueJobs = new List<Job>();
     this.chunkQueues = new Dictionary<Vector2I, ChunkJobQueue>();
     this.jobPool = new JobPool(threadCount);
     this.queuesLock = new SpinLock(10);
 }
Esempio n. 2
0
 /// <summary>
 /// Initialises a new instance of the JobQueue class.
 /// </summary>
 public JobQueue()
 {
     this.queue = new Queue<Job>();
     this.queueLock = new SpinLock(10);
 }