3 ms·
http://msdn.microsoft.com/en-us/library/dd460688(v=vs.110).aspx http://msdn.microsoft.com/en-us/library/dd460688(v=vs.110).a... Parallel LINQ is an extension t
by useerup 12y ago
http://msdn.microsoft.com/en-us/library/dd460688(v=vs.110).aspx http://msdn.microsoft.com/en-us/library/dd460688(v=vs.110).a...
Parallel LINQ is an extension to LINQ (Language Integrated Querying). The "parallel" hints that it is a way to process results in parallel - using multiple threads, possibly on multiple CPUs/cores.
It allows you to express patterns like fork/join in a very elegant, fluent way.
If I have a set of Orders each with a collection of OrderItems, and each OrderItem* has a Consolidate method (I know, contrived, but bear with me).
Orders.SelectMany(o => o.OrderItems).AsParallel().ForAll(Consolidate);
will "consolidate" all of the order items in parallel (or with the optimal degree of parallelism given CPUs/cores).