Jump to content
  • Advertisement
Sign in to follow this  
kaktusas2598

Multi-threading in games

This topic is 1883 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

Hi, I'm learning how to create threads on SDL and at Qt on the same time and my question is connected with it. Is there are real application for multi-threading in games, especially in nowadays games, are multiple threads used often in game development? And can you give me some examples for using this technique in games creation? Thank you :)

Share this post


Link to post
Share on other sites
Advertisement

There is a huge application. Almost all major games (now, because of how easy multithreading is becoming, indie games also) are multithreaded. Many AAA games even have support for up to eight threads (Battlefield 3 and games like it).

 

So yes, multithreading is pretty important :)!

 

Cheers :)!

Share this post


Link to post
Share on other sites

Keep in mind, unless threads are used for a -good- reason they are a total waste and if anything, could lower performance.

 

That said, for anything that can run asynchronously really where the main thread doesn't need to stop and wait for it, definitely a performance boon.

 

Threading isn't exactly some mystical art it just requires preparation and proper areas to use it in. For some languages there is a lot more built in support for threading as well.

Edited by Satharis

Share this post


Link to post
Share on other sites

Despite using C++ and C# together, I depend heavily on C# to do the threading, so far this has been great and though I am not sure if this would be considered the 'best' approach, it works so nicely and so far without any issues.

 

Although somewhat .NET related, this article gives an ok idea of when to have a long running separate running thread instead of using the threadpool / parallel(TPL)  in C#, I know you are using C++ but it still is a pretty decent read. I haven't even bothered reading anything to do with C++ threading, it is the one area in C++ I have just ignored completely lol so im not sure how things work with threading there.

 

My technique atm is focusing on the threadpool (async / await) / TPL / PLINQ etc in .NET, I am still yet to create my own long running thread in C# however, most of the scenarios just don't feel like they need their own personal long running thread, when multithreading is needed I take full advantage of the threadpool and http://msdn.microsoft.com/en-us/library/dd537608.aspx and I haven't really considered my update / render calls to be independent enough for them to have their own dedicated thread. For now I cant see any long term benefits in my apps for having a long running separate thread.

 

0r0d sums up the areas where I use multithreading, the only other area I would say I would use it in is sound manipulation but that isn't something I am even doing in a game.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!