Exactly what is PLINQ?

后端 未结 5 617
遇见更好的自我
遇见更好的自我 2020-12-24 01:23

PLINQ was added in the .NET 4.0 Framework as an extension to LINQ.

  • What is it?
  • What problems does it solve?
  • When is it appropriate and when n
5条回答
  •  忘掉有多难
    2020-12-24 01:57

    It allows you to add .AsParallel to your LINQ to attempt to execute the query using as many processors as possible. Neat, but you still need to know a bit about whether your algorithm is "parallelisable" - it isn't magic.

    It basically removes the need to manage a thread pool and manages synchronising the results coming back from each thread - normally without the parallel extensions library you would have to do this manually.

提交回复
热议问题