假设我有一个工作流程,我想并行执行多次:
System.Threading.Tasks.Parallel.For(
0,
100,
i => WorkflowInvoker.Invoke(
new Workflow1(),
new Dictionary<string, object> { { "Num", i } }));
我想知道,以这种方式执行它是否合法:
var w = new Workflow1();
System.Threading.Tasks.Parallel.For(
0,
100,
i => WorkflowInvoker.Invoke(
w,
new Dictionary<string, object> { { "Num", i } }));