Hyperthreading/Multiple CPU support
by Sid Clink · in Torque Game Engine · 02/09/2005 (7:02 pm) · 9 replies
Does the Torque engine take advantage of multiple CPU's and/or Hyperthreading? With the advent of PCI Express, motherboards with multiple CPU's will be becoming much more common. Also, Intel's dual-core CPU's should be getting cheap enough to afford in a couple years.
#2
02/10/2005 (2:46 am)
I saw Ben (and Melv I think) say somewhere that Torque is not threadsafe and would be very hard to make so...
#3
But it's the nature of simulations to involve a lot of lockstep calculations, making it difficult to break the problem up in a way that's meaningful for multithread-capable hardware. Really the biggest gain you get from running a game on a multicore system is that you can usually end up getting a CPU all to yourself, rather than having to share with everything...
When there's cheap and plentiful multicore systems lying about, it'll be worthwhile to pursue that tech. But until the tech has had time to trickle down to low-end consumer hardware, there's no really good reason to do work in that area - you'll just cut out target audience in exchange for some performance gain on stuff you could be doing in a single thread almost as well...
02/10/2005 (3:02 am)
Ok, it's actually not that hard to make it threadsafe for limited cases (eat your words, Ben! ;).But it's the nature of simulations to involve a lot of lockstep calculations, making it difficult to break the problem up in a way that's meaningful for multithread-capable hardware. Really the biggest gain you get from running a game on a multicore system is that you can usually end up getting a CPU all to yourself, rather than having to share with everything...
When there's cheap and plentiful multicore systems lying about, it'll be worthwhile to pursue that tech. But until the tech has had time to trickle down to low-end consumer hardware, there's no really good reason to do work in that area - you'll just cut out target audience in exchange for some performance gain on stuff you could be doing in a single thread almost as well...
#4
http://www.extremetech.com/article2/0,1558,1826663,00.asp
11/17/2005 (10:27 am)
Dual-core is out, and quad-core is coming in 2007, Ben :). No pressure, hehe.http://www.extremetech.com/article2/0,1558,1826663,00.asp
#5
one thread for rendering triangles
one thread for physics
one thread for AI calcs
one thread for input
11/17/2005 (11:07 am)
What about:one thread for rendering triangles
one thread for physics
one thread for AI calcs
one thread for input
#6
Things like physics will see better returns by threading than input. Libraries like NovodeX take care of threading internally, so at the Torque level you wouldn't need to deal with it.
AI could be tricky to thread depending on the scene data it will have access to.
Pathfinding could be a good choice for threading as long as it maintains it's own world data. Other systems would post requests which would return a few ticks later.
File I/O is a good choice for threading and TSE already does this in the Atlas terrain system.
11/17/2005 (11:37 am)
Tasks that are good to thread are ones that are CPU intensive, have minimal shared data, and do not require a tight sync with the main rendering thread.Things like physics will see better returns by threading than input. Libraries like NovodeX take care of threading internally, so at the Torque level you wouldn't need to deal with it.
AI could be tricky to thread depending on the scene data it will have access to.
Pathfinding could be a good choice for threading as long as it maintains it's own world data. Other systems would post requests which would return a few ticks later.
File I/O is a good choice for threading and TSE already does this in the Atlas terrain system.
#7
11/17/2005 (3:50 pm)
The XB360 uses three cores to pretty good advantage, just maybe not in the convential sense of threads. I'm looking forward to buying my first dual processor, dual core motherboard next year. Probably AMD based, newest Tyan Thunder. Just wish Intel would get its act together so it could also be HT. That would mean 8 hardware-based threads available at anytime. One of those is bound to let Outlook begin when I start that sucker. :o)
#8
11/17/2005 (4:09 pm)
The XB360 uses three cores to pretty good advantage, just maybe not in the convential sense of threads. I'm looking forward to buying my first dual processor, dual core motherboard next year. Probably AMD based, newest Tyan Thunder. Just wish Intel would get its act together so it could also be HT. That would mean 8 hardware-based threads available at anytime. One of those is bound to let Outlook begin when I start that sucker. :o)
#9
11/17/2005 (6:04 pm)
By coincidence the article "Threading 3D Game Engine Basics" was just put up on Gamasutra.
Associate Tom Spilman
Sickhead Games