Beispiel #1
0
 /// <summary>
 /// Enqueue a job on the processor. Automatically distributes tasks without core affinity to the
 /// core with the most availability.
 /// </summary>
 /// <param name="job"></param>
 public void QueueJob(Job job)
 {
     if (job.CoreId >= 0 && job.CoreId < Cores.Length)
     {
         Cores[job.CoreId].QueueJob(job);
     }
     // Swappable tasks
     else
     {
         Cores.OrderByDescending(x => x.Availability).FirstOrDefault()?.QueueJob(job);
     }
 }