comparison Implab/Parallels/DispatchPool.cs @ 125:f803565868a4 v2

improved performance of promises
author cin
date Thu, 15 Jan 2015 12:09:20 +0300
parents dc4942d09e74
children
comparison
equal deleted inserted replaced
124:a336cb13c6a9 125:f803565868a4
28 protected DispatchPool(int threads) 28 protected DispatchPool(int threads)
29 : this(threads, threads) { 29 : this(threads, threads) {
30 } 30 }
31 31
32 protected DispatchPool() { 32 protected DispatchPool() {
33 int maxThreads, maxCP;
34 ThreadPool.GetMaxThreads(out maxThreads, out maxCP);
35 33
36 m_minThreadsLimit = 0; 34 m_minThreadsLimit = 0;
37 m_maxThreadsLimit = maxThreads; 35 m_maxThreadsLimit = Environment.ProcessorCount;
38 } 36 }
39 37
40 protected void InitPool() { 38 protected void InitPool() {
41 for (int i = 0; i < m_minThreadsLimit; i++) 39 for (int i = 0; i < m_minThreadsLimit; i++)
42 StartWorker(); 40 StartWorker();