Thursday, August 28, 2014

How to ensure the item only uses once in parallel foreach loop?

What do you mean for "vw.PHK_NAME will not be used more than once" ?? Do you expect duplicates in EdwProduct collection? Can you say something more please.


Anyway did you post whole code of the loop? If so putting everything in lock { }, is a huge waste because it is making Parallel.ForEach to work like normal non-paraller foreach.


No comments:

Post a Comment