Parallel.ForEach Ordered Execution

后端 未结 6 1762
猫巷女王i
猫巷女王i 2020-12-10 11:10

I am trying to execute parallel functions on a list of objects using the new C# 4.0 Parallel.ForEach function. This is a very long maintenance process. I would

6条回答
  •  温柔的废话
    2020-12-10 12:10

    As an alternate suggestion, you could record which object have been run and then filter the list when you resume exection to exclude the objects which have already run.

    If this needs to be persistent across application restarts, you can store the ID's of the already executed objects (I assume here the objects have some unique identifier).

提交回复
热议问题