Parallel for-each loops in .NET C# z

  • An IEnumerable object
  • An Action of T which is used to process each item in the list
Parallel for-each loops in .NET C# z
List<string> dataList = new List<string> 
{
         "this", "is", "random", "sentence", "hello", "goodbye"
};
 
Parallel.ForEach(dataList, item =>
{
    Console.WriteLine("Item {0} has {1} characters",
        item, item.Length);
});
Parallel for-each loops in .NET C# z

 

Parallel for-each loops in .NET C# z,布布扣,bubuko.com

Parallel for-each loops in .NET C# z

上一篇:Web.config配置文件详解(新手必看) (转载)


下一篇:响应式Web设计