When to use Partitioner class?

前端 未结 3 1611
天涯浪人
天涯浪人 2020-12-24 06:47

Can anyone suggest typical scenarios where Partitioner class introduced in .NET 4.0 can/should be used?

3条回答
  •  粉色の甜心
    2020-12-24 07:29

    To parallelize an operation on a data source, one of the essential steps is to partition the source into multiple sections that can be accessed concurrently by multiple threads. PLINQ and the Task Parallel Library (TPL) provide default partitioners that work transparently when you write a parallel query or ForEach loop. For more advanced scenarios, you can plug in your own partitioner.

    Read more here:

提交回复
热议问题