I'm dealing with rather large data sets and am testing different approaches to get the fastest output. At this current stage in testing I have nested parallel loops like so:
Parallel.ForEach(listOne, itemOne =>
{
Parallel.ForEach(listTwo, itemTwo =>
{
Parallel.ForEach(listThree, itemThree =>
{
//do stuff
});
});
});
This is obviously just an example of how my code is being used. What would be the best way (if any) to set a MaxDegreeOfParallelism
value so that it could be utilized by each of the loops?
I understand I can set a value for the MaxDegreeOfParallelism
in each of the loops options, but I'm not sure how that would be as a final result. And finally, would setting a MaxDegreeOfParallelism
value even be necessary/useful in this scenario?