O'Reilly logo

C# Multithreaded and Parallel Programming by Rodney Ringler

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Merging in PLINQ

We have learned how to perform a parallel query and how to order the results. Now, let's examine merging with our parallel queries.

When a parallel query is performed, the .NET CLR partitions the source collection so that several tasks can work sections of the collection concurrently. Once this is completed, the results need to be merged into a result collection for processing. Depending on the query operators used, the results can be merged in different ways. Query operators that dictate a new order on the result collection will buffer all items from the separate threads before merging them together again. Other query operators are partially buffered, while the query operator, ForAll<TSource>, is not buffered. It produces all ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required