I have a simple algorithm like this:
Parallel.ForEach(myList, new ParallelOptions() { MaxDegreeOfParallelism = 4 } ,(job) => job.doSomething());
myList is a List<MyType>.
MyType has void DoSomething().
inside DoSomething I check Thread.CurrentThread.IsThreadPoolThread.
Some threads aren't "ThreadPooled";
The functions defined in Parallel will also use the thread you called the function from as one of the worker threads. Most likely the non Thread Pool threads where jobs done on the thread you called Parallel.ForEach from.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With