Exemplo n.º 1
0
        public SpreadsThreadPool(ThreadPoolSettings settings)
        {
            workQueue = new ThreadPoolWorkQueue(this);
            Settings  = settings;
            _workers  = new PoolWorker[settings.NumThreads];

            for (int i = 0; i < settings.NumThreads; i++)
            {
                _workers[i] = new PoolWorker(this, i);
            }
        }
Exemplo n.º 2
0
 private static void InitDefault()
 {
     lock (typeof(SpreadsThreadPool))
     {
         if (_default == null)
         {
             var settings = new ThreadPoolSettings(DefaultDedicatedWorkerThreads,
                                                   "DefaultSpreadsThreadPool");
             _default = new SpreadsThreadPool(settings);
             ThreadPool.SetMinThreads(settings.NumThreads, settings.NumThreads);
         }
     }
 }