Provides a task scheduler that ensures a maximum concurrency level while running on top of the ThreadPool.
Наследование: System.Threading.Tasks.TaskScheduler
Пример #1
0
        public void Sort(int threadnum = -1)
        {
#if NO_SUPPORT_PARALLEL_LIB
#else
            parallelOption.MaxDegreeOfParallelism = threadnum;
            if (threadnum > 0)
            {
                lcts = new LimitedConcurrencyLevelTaskScheduler(threadnum * 2);
                parallelOption.TaskScheduler = lcts;
            }
#endif
            QuickSort(0, Count - 1);
        }
Пример #2
0
        public DoubleArrayTrieBuilder(int thread_num)
        {
            array = null;
            thread_num_ = thread_num;
#if NO_SUPPORT_PARALLEL_LIB
#else
            lcts = new LimitedConcurrencyLevelTaskScheduler(thread_num_ * 2);
            parallelOption = new ParallelOptions();
            parallelOption.TaskScheduler = lcts;
#endif
            lastQPS = 0.0;
            lastQPSDelta = 0.0;
        }