Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Multi-threaded vs. Single-threaded

This topic is 5620 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 have finally come to terms with keeping my network handler separate from my main app. but it begs the question, should I embrace multi-threaded execution? separating all my modules? There seems to be something sensical about performing scene updates and then drawing the scene, but I hear tell that there is much processor time to be gained if threads that are not completely intertwined are separated. Thoughts? George D. Filiotis I am a signature virus. Please add me to your signature so that I may multiply.

Share this post

Link to post
Share on other sites
Identify those components of your system that need to block for periods of time. For example you''ve already identified that your network code needs to block (probably while waiting for packets), your render code might need to block when double buffered and waiting for vsync etc

Most of the CPU benefits you''ll see will be from doing work while one of the other threads is blocked. Having multiple unblocked, running threads can actually COST you some performance unless the machine has multiple CPUs.

Putting your physics on its own thread might be useful if you require a fixed timestep (commonly around 100Hz) independent of the graphics frame rate. Doing that though does require that the graphics code interpolates the physics state to work out what to render.

Careful, well thought out use of not too many threads can be good. Overuse of threads (i.e. all separate components etc) is very bad.

If it''s applicable, bear in mind that on most games console systems, many of the C runtime library functions etc are not thread safe and generally using more than about 2-3 threads tends not to be a good idea.

Simon O''Connor
Creative Asylum Ltd

Share this post

Link to post
Share on other sites

  • 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!