I need to get 25 thread max since I am using thread pool.
The number of threads in the thread pool per core has changed a lot over time. This is no more than 25 per core, which I suspect you expect.
For example, running this on my quad-core hyperthreading laptop with .NET 4, I get 32767 workflows and 1000 I / O ports:
using System; using System.Threading; class Test { static void Main() { int worker; int ioCompletion; ThreadPool.GetMaxThreads(out worker, out ioCompletion); Console.WriteLine("{0} / {1}", worker, ioCompletion); } }
In .NET 3.5, I get 2000 workflows and still 1000 I / O ports.
Jon skeet
source share