Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Don't forget to read Tuesday's email newsletter for your chance to win a free copy of Construct 2!


Parallel query executing sequentially


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   -  Reputation: 318

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.

Sponsor:

#2 Narf the Mouse   Members   -  Reputation: 318

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.



PARTNERS