Jump to content
  • Advertisement
Sign in to follow this  
lucky6969b

Doubts about thread consumption

This topic is 840 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm currently having

one mainthread for coordination for everything

one thread for astar (ad hoc, requested on demand),

one thread for timeastar (stay resident, always active)

one thread for polling for object arrivals (stay resident, always active)

one thread for physics (stay resident, always active)

 

Should I open 2 more threads for rendering?

I am a little bit short of hardware concurrency....

But the program runs pretty well.

Any ideas?

Thanks

Jack

 

 

Share this post


Link to post
Share on other sites
Advertisement

The number of threads generally won't matter in such a functional model, so long as you stay in reasonable bounds such as less than 100.  My multicore engine currently starts up 19 utility threads beyond the 1 thread per hw thread (i.e. 6 core ht box, 19+12 total threads) and it works like a charm.  The reason is that the 19 threads are generally all very light weight and primarily IO bound items which run in the small gaps where the multi-core is not 100% active.  This same sort of interleaving will happen in a functionally threaded engine just as well and adding more threads is highly unlikely to be a detriment.

Share this post


Link to post
Share on other sites

I'm currently having

one mainthread for coordination for everything

one thread for astar (ad hoc, requested on demand),

one thread for timeastar (stay resident, always active)

one thread for polling for object arrivals (stay resident, always active)

one thread for physics (stay resident, always active)

 

Should I open 2 more threads for rendering?

I am a little bit short of hardware concurrency....

But the program runs pretty well.

Any ideas?

Thanks

Jack

 

Depends on what kind of work you are doing on each thread.

You can't just create more threads and magically solve your concurrency issues.

I hope you are not doing anything with the GPU in other threads, if not, you could open a thread for rendering since it just sends commands to the GPU.

Share this post


Link to post
Share on other sites

It really depends on what you're trying to achieve. If you're trying to program a game engine, then you've made a very poor design decision. Let me know what you're trying to achieve, and I'll make some suggestions.

Edited by Tangletail

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!