Ray's playground

 

Item 35: Learn How PLINQ Implements Parallel Algorithms(Effective C#)

Every parallel query begins with a partitioning step. PLINQ needs to partition the input elements and distribute those over the number of tasks created to perform the query. Partitioning is one of the most important aspects of PLINQ, so it is important to understand the different approaches, how PLINQ decides which to use, and how each one works. First, partitioning can’t take much time. That would cause the PLINQ library to spend too much time partitioning, and too little time actually processing your data. PLINQ uses four different partitioning algorithms, based on the input source and the type of query you are creating. The simplest
algorithm is range partitioning. The second choice for partitioning is chunk partitioning. The other two partitioning schemes optimize for certain query operations.
First is a striped partition. The final algorithm is a Hash Partitioning.

 

posted on 2011-02-23 20:48  Ray Z  阅读(179)  评论(0编辑  收藏  举报

导航