Jump to content

View more

Image of the Day

The beast has a mighty searchlight of evil! #screenshotsaturday https://t.co/bzKepOojDL
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

Parallel query executing sequentially

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
1 reply to this topic

#1 Narf the Mouse   Members   

322
Like
0Likes
Like

Posted 21 June 2012 - 07:08 PM

The .Where( ) function in the following code is executing in sequential; following the code in the debugger reveals only one thread. It is also, by profiling, the slowest part of my code.

models is List<Model> of 15,000 models.
Frustum is a struct.
var frustum = camera.Frustum;

var drawn = models.AsParallel( ).AsUnordered( ).Where(
	 model => IntersectionTests.AABBXFrustum( model.BoundingAABB, frustum )
	 ).ToList( ) ;
If you need more information, I can provide it, but I don't see how anything not referenced in the function could be affecting it.

My question, then, is why is it executing sequentially and how do I fix it so it runs in parallel?

Thanks.

#2 Narf the Mouse   Members   

322
Like
0Likes
Like

Posted 21 June 2012 - 08:07 PM

Never mind; a closer look shows it executing in parallel.

(You have to set a breakpoint inside the code to be executed in parallel, then F5 to that)




Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.