I have, let’s say, a list with 500 objects. For each object, I’m calling a function calculating it’s cost. So each of the 500 calls is independent from the others. The overall takes around 30 seconds. Wouldn’t it be possible to run all the 500 tasks at the same time as they don’t rely on each other ? I know nothing about multi-threading therefore I don’t know if it could be a solution.
Share
You can easily parallelize the work using the Parallel.ForEach Method: