Perhaps I did not understand this correctly ... all the problems of the Parallel class :(
But from what I'm reading now, I understand that when I use Parallel, I actually mobilize all the threads that exist in threadPool for some task / mission.
For example :
var arrayStrings = new string[1000]; Parallel.ForEach<string>(arrayStrings, someString => { DoSomething(someString); });
So, Parallel.ForEach in this case mobilizes all the threads that exist in threadPool for the DoSomething task / mission.
But does Parallel.ForEach call any new thread?
Clearly there will be no 1000 new threads. But let's assume that there are 1000 new threads, in which case threadPool releases the whole thread that it holds so, in this case ... Parallel.ForEach will create any new thread?
source share