嗨,
以下代码工作正常但有时我得到操作被取消异常?
var _options = new ParallelOptions();
_options.MaxDegreeOfParallelism = 5;
Parallel.Invoke(_options,
() =>
{
//get list of item1
foreach (var item in lst_item1)
{
// do some logic here
}
},
() =>
{
//get list of item1
foreach (var item in lst_item2)
{
// do some logic here
}
},
() =>
{
//get list of item1
foreach (var item in lst_item2)
{
// do some logic here
}
});
// continue logic code
非常感谢任何帮助!
此致