Пример #1
0
        public DedicatedThreadPool(DedicatedThreadPoolSettings settings)
        {
            _workQueue = new ThreadPoolWorkQueue();
            Settings   = settings;
            _workers   = Enumerable.Range(1, settings.NumThreads).Select(workerId => new PoolWorker(this, workerId)).ToArray();

            // Note:
            // The DedicatedThreadPoolSupervisor was removed because aborting thread could lead to unexpected behavior
            // If a new implementation is done, it should spawn a new thread when a worker is not making progress and
            // try to keep {settings.NumThreads} active threads.
        }
Пример #2
0
		public DedicatedThreadPool(DedicatedThreadPoolSettings settings)
		{
			_workQueue = new ThreadPoolWorkQueue();
			Settings = settings;
			_workers = Enumerable.Range(1, settings.NumThreads).Select(workerId => new PoolWorker(this, workerId)).ToArray();

			// Note:
			// The DedicatedThreadPoolSupervisor was removed because aborting thread could lead to unexpected behavior
			// If a new implementation is done, it should spawn a new thread when a worker is not making progress and
			// try to keep {settings.NumThreads} active threads.
		}