Parallel for loops in .NET C# z

  • The start index: this is inclusive, i.e. this will be the first index value in the loop
  • The end index: this is exclusive, so it won’t be processed in the loop
  • An Action of int which represents the method that should be executed in each loop, where int is the actual index value
Parallel.For(0, 10, index =>
{
    Console.WriteLine("Task Id {0} processing index: {1}",
        Task.CurrentId, index);
});

 

Parallel for loops in .NET C# z,古老的榕树,5-wow.com

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。