public void ChannelSimpleJobs() { for (int i = 0; i < numJobs; i++) { BenchJob job = new BenchJob(); job.f1 = i; job.f2 = i + 1; ChannelJobs.QueueJob(job); } ChannelJobs.CompleteAll(); }
public void SystemTasks() { Task[] tasks = new Task[numJobs]; for (int i = 0; i < numJobs; i++) { BenchJob job = new BenchJob(); job.f1 = i; job.f2 = i + 1; tasks[i] = Task.Run(() => job.Execute()); } Task.WaitAll(tasks); }
public void ConcurrentQueueWorkers() { var group = JobWorkersManager.StartJobGroup(); for (int i = 0; i < numJobs; i++) { BenchJob job = new BenchJob(); job.f1 = i; job.f2 = i + 1; JobWorkersManager.QueueJob(job, group); } JobWorkersManager.CompleteAll(); }