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.