.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Post New Web Links

Parallel LINQ: Running Queries On Multi-Core Processors

Posted By:      Posted Date: August 21, 2010    Points: 0   Category :ASP.Net

Use Parallel Language Integrated Query (PLINQ) to take advantage of multi-processor computers and the newer wave of multi-core processors.

Joe Duffy and Ed Essey

MSDN Magazine October 2007

View Complete Post

More Related Resource Links

Parallel Performance: Optimize Managed Code For Multi-Core Machines


While multi-core processors have become increasingly common, most applications still fail to take advantage of multiple cores. Here's an overview of creating multithreaded applications that benefit from these new processors.

Daan Leijen and Judd Hall

MSDN Magazine October 2007

Which tier do Linq queries belong?


Started in middle of a new project.  Our design architecture uses an n-tier (not MVC - no controllers) structure with Presentation, Data, Business and Service tiers.  However the lead analyst has the majoriety of code all in the Business tier claiming it all contains Business logic.  Our data tier is nothing more than a single .dbml model of the primary database to support all of the Linq queries in the Business tier.  To my mind Linq queries and classes they use are data access and belong in the data tier  but our lead analyst says they contain business logic therefore have to be in business layer.  

Data Points: LINQ Projection Queries and Alternatives in WCF Services


LINQ's ability to project randomly shaped data into anonymous types can be a blessing and a source of frustration, says Julie Lerman. It's great when you just need to grab a special view of your data, but it can be problematic in certain circumstances. She explains what the limitations are and how to get around them.

Julie Lerman

MSDN Magazine May 2010

Data Points: Precompiling LINQ Queries


Did you know that by precompiling LINQ queries you might actually be degrading your app's performance if you're not careful? Julie Lerman explains how to ensure you're not re-precompiling queries each time and losing the expected performance benefits across post-backs, short-lived service operations and other code where critical instances are going out of scope.

Julie Lerman

MSDN Magazine March 2010

Toolbox: Easy LINQ Queries, Becoming A Better Developer, And Logging Help


This month Toolbox provides help with error logging, finds an app that helps you write LINQ queries, and explores the non-technical side of development.

Scott Mitchell

MSDN Magazine September 2008

Time Difference in Linq queries


Hi All,


I have my Linq query in which i need to find time difference(not days difference).

The field in database is datetime.

Dim ldtToday As DateTime = TimeOfDay

Dim SR_RM_InnerJoin = From SR In lcntxRT60Entities.RtSReports _

Join RM In lcntxRT60Entities.RtRMaster On SR.RtRMaster.ReportID Equals RM.ReportID _

Select SR, RM _

Top 100 sql queries running on all database

hi This is sql server 2008, I am trying to find the top 100 queries on all database that has the high CPU usage. Trying to find the database, CPU usage and queries. I have something here, but does not show the query part. SELECT   [sql_handle]   ,[statement_start_offset]   ,[statement_end_offset]   ,[plan_generation_num]   ,[plan_handle]   ,[creation_time]   ,[last_execution_time]   ,[execution_count]   ,[snapshot_execution_count]   ,[total_worker_time]   ,[snapshot_worker_time]   ,[min_worker_time]   ,[max_worker_time]   ,[total_physical_reads]   ,[snapshot_physical_reads]   ,[min_physical_reads]   ,[max_physical_reads]   ,[total_logical_writes]   ,[snapshot_logical_writes]   ,[min_logical_writes]   ,[max_logical_writes]   ,[total_logical_reads]   ,[snapshot_logical_reads]   ,[min_logical_reads]   ,[max_logical_reads]   ,[total_clr_time]   ,[snapshot_clr_time]   ,[min_clr_time]   ,[max_clr_time]   ,[total_elapsed_time]   ,[snapshot_elapsed_time]   ,[min_elapsed_time]   ,[max_elapsed_time]   ,[collection_time]   ,[snapshot_id]   FROM [Data Collection].[snapshots].[query_stats]    

Forcing parallel plan for CPU limited queries

I have a simple query: INSERT tableB SELECT SomethingSlowFunction(value) FROM tableA SomethingSlowFunction is a bunch of trigonometric function calls on many columns of the table, all pure T-SQL, no CLR involved. The query is CPU limited (100% on one of the 8 CPUs). If I change the query a little bit (i.e. add a SORT BY) that will cause parallel execution but the sort will take a lot of resources (tempdb munching). Any tips?

Query to list currently running queries on the sql server 2000

Hi all Who to check, what all queries are running curently on the sql server 2000, I need to list who all logged in and what queries are getting executed and how long its running. Thanks in advance. shan  

Join linq queries with same field name

Hi everyone-I'm trying to join three Linq queries together.  One of the fields (rating) is the same name for each so when I add b.rating as you'll see below, I get a squiggly that says "Anonymous type member or property 'rating' is alread declared.   Dim customerCategoryA= (From a In dc.CategoryARatings _                                  Where a.userID = userID _                                  Select New With {a.productID, a.rating, a.ratingComment}) Dim customerCategoryB = (From b In dc.CategoryBRatings _                                 Where b.userID = userID _                                 Select New With {b.productID, b.rating}) Dim DataForGridview = From p In Products _   

Asynchronously Load LINQ Queries/Repeaters in Sections with Web Service



I'm trying to  figure out the best way to load my main page faster.  What I'd like to do is have the bare bones of the master page display right away and on the Default.aspx Page_Load, call some web services that would query the rest of the items, in chunks, and then display.  I have 3 or 4 queries, which would be the chunks I am talking about. 

How would I accomplish this?  I tried putting Update Panels around the repeaters, but that didn't make the page show any faster, and the page still only displayed once all the data was queried.

I found this article, http://msdn.microsoft.com/en-us/library/2e08f6yc.aspx.  Could I call a web service and return a Linq Query and populate a Repeater on Default.aspx?  Would I need an Update Panel around the Repeater still?

I also found this article, which was very interesting in that it parsed and returned the actual HTML to plug into the page, http://encosia.com/2008/02/05/boost-aspnet-performance-with-deferred-content-loading/

I've been reading both of these for a while to try to understand which may be the best method to proceed with.  I'd really appreciate any a

How to estimate "Minimum query plan threshold for considering queries for parallel execution(cost es



We have 4 QUAD core processors and we have set max degree of parellelism to 4(as suggested by Microsoft). As of now we are using the default value for "Minimum query plan threshold for considering queries for parallel execution(cost estimate)".

Please suggest how to estimate the best value for for "Minimum query plan threshold for considering queries for parallel execution(cost estimate)"?

Thanks in advance.



SQL Server 2008 R2 Standard edition running from one Core


Hi, I have a client who we just upgraded to Win 2008 R2 Standard Edition and SQL 2008 R2 Standard Edition

They are complaining about System performance. 

Looks like SQl runs only on 1 core, maybe sometime 2 which is maxed out.

"Automatically set Processors affinity mask for all processors" is checked and also

"Automatically set I/O affinity mask for all processors" is checked...

The server was maxed out with memory a few days ago but looks to me that that is something taht SQL 2k8 R2 does. The server has got 16GB ram

Pretty urgent. Got 3 hours to solve it.



can sql queries work on the same form with Linq queries



I have a windows form with VB  and SQL database ,and i find that once i have written some Linq queries that the SQL queries do not work anymore . Is there any reaon for this and if so how can i overcome it?

THanks Rob


Can LINQ be used with sql queries



I have a windows form with VB  and SQL database ,and i find that once i have written some Linq queries that the SQL queries do not work anymore . Is there any reaon for this and if so how can i overcome it?

THanks Rob


LINQ 2 SharePoint: recursive queries

Hi all,
is there a way to search items in a recursive way on a SharePoint 2010 list using LINQ?
For example, I have to search the last uploaded video in an Asset Library. This video can be uploaded on the root path or inside a folder. My query has to retrieve the last video uploaded, no matter if inside a folder or not.

This was possible with CAML: it was sufficient to set the scope attribute of a query to "Recursive". I am not able to do the same with LINQ.

Can anybody help me with this topic? Thanks.

What is the advantage of Parallel Processing(Programming) aganist Multi threading

we are already getting parallel processing from w2k8 and the underlying intel processors evidenced by running an application on a single purpose machine and it showing all cores having equal usage Then why do we go for Parallel Programming in vs 2010?
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend