Question

I just watched the last Channel 9 vid on the upcoming parallel extensions to .NET. How would you use this in a web app? I'm specifically thinking of using the parallel Linq extensions against a SQL db. Would this makes sense to use as a way to speed up your data access layer in a multi-user server app? What are the issues (aside from the obvious thread safety issues using static collection types)?

Was it helpful?

Solution

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

LINQ-to-SQL and LINQ-to-Entities queries will still be executed by the respective databases and query providers, so PLINQ does not offer a way to parallelize those queries. If you wish to process the results of those queries in memory, including joining the output of many heterogeneous queries, then PLINQ can be quite useful.

As for the usage of PLINQ in a web app, if the request requires many in-memory calculations in witch PLINQ might be useful (like if you have several data sources that you'd like to query together) I see no problems in using it.

OTHER TIPS

Parallel LINQ is primarily intended to work against in-memory collections, I believe. How were you anticipating using it against your database?

Given that webapps are naturally pretty parallel (in terms of separate requests executing on separate threads etc) I suspect that PLINQ won't really apply to it much.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top