One fall of the pit - you lose the ability to use order in sets.
Take the following code:
var results = new int { 0 ,1 ,2 ,3 }; var doSomethingSpecial = (from r in results.AsParallel() select r / 2).ToArray();
You cannot count on the results coming in order, so the result can be any permutation of the set. This is one of the biggest mistakes, in the sense that if you are dealing with ordered data, then you may lose performance advantages due to the cost of sorting.
Another problem is that you lose the ability to detect known exceptions. Thus, I could not catch the null pointer exception (without saying you should do this) or even catch the FormatException exception.
There are many reasons why you should not always use Plinq in all cases, and I highlighted one more. Do not read also "automatic use of non-parallel Linq", it can only handle barrier cases when the request is simple, or will be too complicated for parallel operation.
Always remember that the more PLINQ uses the more resources that you will consume on the server, which are removed from other working threads.
Resources
MSDN PLNQ Technical Documentation
Paul Kimmel on PLINQ
Nix May 23 '10 at 23:17 2010-05-23 23:17
source share