Parallel LINQ in WebApps?

I just watched the latest Channel 9 vid about upcoming concurrent .NET extensions. How can you use this in a web app? I am specifically considering using Linq parallel extensions against SQL db. Would this be useful as a way to speed up the data access layer in a multi-tenant server application? What are the issues (besides the obvious thread safety issues with using static collection types)?

+1


source to share


2 answers


I think this paragraph, extracted from this article , explains the use of PLINQ-to-SQL:

LINQ-to-SQL and LINQ-to-Entities queries will still execute the corresponding database and provider query, so PLINQ does not offer a way to parallelize these queries. If you want to process the results of these queries in memory, including combining many heterogeneous queries, then PLINQ can be quite useful.



As far as using PLINQ in a web application, if a query requires a lot of in-memory computation in witch PLINQ might be useful (for example, if you have multiple data sources that you want to query together), I see no problem in using it.

+5


source


Parallel LINQ is primarily designed to work with collections in memory, I believe. How would you expect to use it against your database?



Considering webapps are naturally quite parallel (in terms of separate requests being made on separate threads, etc.). I suspect PLINQ doesn't really relate to it very much.

+4


source







All Articles