Ejemplo n.º 1
0
        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();
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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();
        }