comparison Implab/Parallels/WorkerPool.cs @ 119:2573b562e328 v2

Promises rewritten, added improved version of AsyncQueue
author cin
date Sun, 11 Jan 2015 19:13:02 +0300
parents 4c0e5ef99986
children 471f596b2603
comparison
equal deleted inserted replaced
118:e046a94eecb1 119:2573b562e328
4 using Implab.Diagnostics; 4 using Implab.Diagnostics;
5 5
6 namespace Implab.Parallels { 6 namespace Implab.Parallels {
7 public class WorkerPool : DispatchPool<Action> { 7 public class WorkerPool : DispatchPool<Action> {
8 8
9 MTQueue<Action> m_queue = new MTQueue<Action>(); 9 AsyncQueue<Action> m_queue = new AsyncQueue<Action>();
10 int m_queueLength = 0; 10 int m_queueLength = 0;
11 readonly int m_threshold = 1; 11 readonly int m_threshold = 1;
12 12
13 public WorkerPool(int minThreads, int maxThreads, int threshold) 13 public WorkerPool(int minThreads, int maxThreads, int threshold)
14 : base(minThreads, maxThreads) { 14 : base(minThreads, maxThreads) {