I could pretty much bust this myth with one picture. It's a screenshot of Resource Manager while Unreal Tournament 3 is running a session of 31 bots on the Suspense vehicle CTF map.
And this busts two myths I keep hearing about games using "last generation" engines (or maybe they're still current generation, I don't really know anymore)
- Game engines don't have any more than two threads. As Resource Manager shows, Unreal Tournament 3 is at 29 threads. Huh.
- Game engines don't use any more than two cores. Resource manager reports that Unreal Tournament 3 is hovering at 40% CPU usage at the time of the screen capture. If you look at the CPU utilization chart on the right, all four cores in my setup are actually doing something, and are all hovering at about 40%-50%. CPU utilization is reported as an average across all cores; Unreal Tournament 3 is really using those four cores.
I have some plausible explanations as to why people think this and I want to clear those misconceptions up.
- Not understanding what a thread really is. A thread is basically a task within a application (or "process" in computer science lingo). That task is programmed to do some kind of work. In a properly designed application, threads will work on some independent aspect of the process. For a game, these threads could be the main executable which oversees everything, the physics routine, the AI routine, and the GPU job compiler. We also could, in theory, make that game only have one thread, which does everything. But that's not really a smart way of programming.
If we have a GUI based program that is single threaded, then say it tries to load a large file. During that loading period, the entire program appears frozen because the thread is now working on getting that file. If the GUI task was on a separate thread, the GUI can still be rendered and it'll probably give you a progress bar while the other thread which is loading the file finishes.
- Games don't know about multiple cores to take advantage of 'proper' multithreading. I might not be the best person to talk this one out, but I'll throw out an explanation anyway. As far as I know, applications have no concept of multiple cores or multithreading capabilities of a processor. All they know is they have some processor, some chunk of memory, and an OS they need to go through to get lined up to be served. It's really up to the OS to figure out what execution resources it has and how to properly distribute it. If games were truly "dual-core" only, you'd see only two cores at work and the other two parked.
- The minimum requirements of a game are dual-core processors, therefore that's all it was designed to run on. Again, application programs have no concept of what a x-core processor is. It just knows it has a processor that it needs to go to the OS to get some execution time.
But there's one more thing that I don't get why this myth even exists: consoles. The PlayStation 3 on the high level detail is essentially a 7-core processor (with 6-cores available for games). The Xbox 360 is a 3-core processor (with 2-threads per core). Basically, last generation consoles needed to have games run on six-threads of execution to get the most out of the system. If games were truly dual-core/dual-thread... that's a lot of power being wasted and we should fire the entire gaming industry.