comparison Implab/Parallels/DispatchPool.cs @ 93:dc4942d09e74 v2

improved tracing added the application components container MTComponentContainer.AppContainer
author cin
date Thu, 23 Oct 2014 01:13:57 +0400
parents 4c0e5ef99986
children f803565868a4
comparison
equal deleted inserted replaced
92:4c0e5ef99986 93:dc4942d09e74
5 public abstract class DispatchPool<TUnit> : IDisposable { 5 public abstract class DispatchPool<TUnit> : IDisposable {
6 readonly int m_minThreadsLimit; 6 readonly int m_minThreadsLimit;
7 readonly int m_maxThreadsLimit; 7 readonly int m_maxThreadsLimit;
8 readonly int m_releaseTimeout = 1000; // the timeout while the working thread will wait for the new tasks before exit 8 readonly int m_releaseTimeout = 1000; // the timeout while the working thread will wait for the new tasks before exit
9 9
10 int m_threads = 0; // the current size of the pool 10 int m_threads; // the current size of the pool
11 int m_maxRunningThreads = 0; // the meximum reached size of the pool 11 int m_maxRunningThreads; // the meximum reached size of the pool
12 int m_exit = 0; // the pool is going to shutdown, all unused workers are released 12 int m_exit; // the pool is going to shutdown, all unused workers are released
13 13
14 readonly object m_signal = new object(); // used to pulse waiting threads 14 readonly object m_signal = new object(); // used to pulse waiting threads
15 15
16 protected DispatchPool(int min, int max) { 16 protected DispatchPool(int min, int max) {
17 if (min < 0) 17 if (min < 0)