Recently I made a couple of measures about Linq and Plinq. I can't see in which situation has a real significant benefit of Plinq.
I've found many examples such as:
Enumerable.Range(0, 10000).AsParallel().ForAll(_ => Thread.Sleep(50000));
This is totally useless example, because it can be parallized with degree of 10000 and yes then will be faster 10000 times, but it's rare in a business application to loop 10000 times and making "IO jobs".
If somebody can mention an example please post it.
Plinq is only available for Linq to Objects and Linq to XML. Not suggested to use it in application which runs on webserver(it has own thread management). So our opportunities are reduced to desktop applications which have multiple cores.
Usually I write linq queries which runs sequentially in fractions of a second. If I parallize it and it really will run parallel then will be faster, but who cares? I think it is still fast enough. The end user won't see any difference.
I can imagine an example when somebody gets all data from DB and running query in memory. Then maybe it's useful, but it's a wrong design.
TPL is a good stuff for asyncron programming, but I'm still not sure Plinq is a useful tool.
Does anybody have positive experience about that?