Jump to content
  • Advertisement

Archived

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

Forcas

Multi-threading

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

Would it be beneficial to seperate my graphics code and my input code in to two seperate threads, or is multi-tasking mostly used for AI, etc?

Share this post


Link to post
Share on other sites
Advertisement
My advice is, if you don''t know exactly why or why not to use multi-threading, then you probably shouldn''t use it at all in a game. It''s certainly possible to make your game run faster, but it''s far, far easier to make it run slower with multiple threads.


codeka.com - Just click it.

Share this post


Link to post
Share on other sites
I''m not sure of their applications in game code but threads are commonly used in real-time systems. The idea being that some threads have greater importance than others (usually) allowing you to create complex code whilst still ensuring that your time crucial code can always be executed in time.

I guess in game design you may place the sound and rendering code in critical threads whilst the AI would sit in a low priority one. If the enemy suddenly goes dumb for 200 ms you won''t notice but if the screen fails to update you will.

I can''t see the benefit of separating your input code and certainly not until your game starts to put a strain on the systems your aiming to run it on. AI seems to be one areas that would benefit. Of course if your aiming at a multiple processor system then you could design multi-threaded code that can execute far faster by executing code concurrently, but thats a whole different problem...

zipless

Share this post


Link to post
Share on other sites
At a certain level, every process that should operate in parallel deserves to be in a separate thread. Hardware limitations, however, force us to combine some of them. It''s usually a good idea to put graphics in one thread, input and logic in another and sound in a third. That''s a minimum generic reasonable threading model; the model used by each application, however, is dependent on the application itself.

And speaking of threads... Dean, I''ll email you. We should decide where to go with ARMS.



I wanna work for Microsoft!

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.

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

Sign me up!