-1
\$\begingroup\$

Are there any games that can really benefit from use of quad core CPU instead of two-core one like

Intel Core i3 4340 vs Intel Core i5 4590

Basically they are quite similar in terms of frequency/caches/features, but first one have only two real cores and second one have 4 real cores.

so are there any benefits for games for the second choice?

P.S. I believe that 4M of cache for two cores is quite better than 6M for 4 cores ;)

\$\endgroup\$
4
  • \$\begingroup\$ Games aren't written to use 'cores'. They are written to use different 'threads'. \$\endgroup\$ – Joe Swindell Jul 14 '14 at 12:09
  • \$\begingroup\$ But I'm asking not about threads but about any REAL benefits of 4+ cores as even 100 threads may be not able to run in parallel ;) \$\endgroup\$ – Ruslan Jul 14 '14 at 12:39
  • \$\begingroup\$ This question appears to be off-topic because it is about choosing a processor for playing games, not game development. \$\endgroup\$ – MichaelHouse Jul 14 '14 at 13:50
  • \$\begingroup\$ Actually, games are written to target some given number of cores. This in large part informs how they design their threading model. The traditional game loop is very much single-threaded, which is why games initially had a hard time with dual-core PCs and taking advantage of Xbox 360's 3 cores. Most game devs for AAA titles have wrapped their heads around doing two heavy-weight threads (one render, one for everything else) and a few helper threads floating about. This works ok for 3-4 cores, but can't do much with more than that. Current gen consoles are pushing them to 4 heavy-weight threads. \$\endgroup\$ – Chuck Walbourn Jul 14 '14 at 18:29
9
\$\begingroup\$

Games will not benefit that much by having 4 cores instead of two. Here's why.

Basic Game Engine: 1 Thread

The problem with graphics API like DirectX and OpenGL is that it must be runned on one thread, and one thread only. So a basic game engine will run all of the logic and render logic into a single thread. These engines will often use a time delta to synchronize the updating of the game world accordingly to the render FPS.

Ex.: libGDX, SDL

Update and Render Loops Game Engines: 2 Threads

These engines pose a clear separation between the update of the game world and its rendering. They will sometimes separate these 2 logics into 2 threads to gain a small performance gain but mainly asynchronous rendering. This means that the game can render at 400 FPS and the logic will still update at 60 FPS.

Ex.: Most high-end game engines, like Unreal, CryEngine or Frostbite

Physics thread: +1 to X Thread

Some games will like to put physics calculation in another thread so it doesn't mess with the updating or the rendering.

Networking: +1 to X Thread

Game with online gameplay will often use a separate thread because most networking engines are blocking, which means the thread will block until data is received.

Disk IO operations: +1 to X Thread

File management on large files can block a thread for a small amount of time, so most game engine will put disk IO operations on another thread.

Summary

Basicaly, most game engines will use 1 or 2 threads for the game's frame and will add some threads for other operations. But mostly, a game will only use 1 or 2 cores. If the game has heavy physics, like Frostbite engine for the BattleField series, then the game will start using more than 2 cores.

CPU thread optimisation

Mostly, a CPU will run different threads on different cores. But that may not always be the case. Like Joe Swindell said in the comments, games are not actually written to use cores, but when you write threads, you hope that they will run so that the CPU will distribute them to different cores.

Conclusion

What matters in the end is chosing the right CPU for the games you want to play or make. For small to medium games like Minecraft, then it is useless to buy a 4, 6 or 8 cores CPU. For high-end games, then 4 cores becomes the better option. If you want to program games, the more cores the better for compiling (depends on the compiler) but for the actual game, 2 cores is more than enough.

Cache P.S.

Yes, 4MB cache on 2 cores will be better than 6MB cache on 4 cores. But this is not the most important thing to look for on a CPU. It really comes down to the clock speed.

\$\endgroup\$
4
  • 1
    \$\begingroup\$ Threads that are used to solve blocking behaviour of some libraries don't get any benefit from multiple cores as waiting threads do not block a core. Some physic libraries, eg PhysX 3.x can use multiple threads to calculate physics in parallel and benefit basically from an unlimited number of cores when the physic requirements of the game are very high. As the OS does have to do stuff in parallel I would definitly prefere 3-4 Cores to 2. \$\endgroup\$ – Archy Jul 14 '14 at 14:30
  • \$\begingroup\$ Given that large number of PC games designed around consoles and then ported, 4 cores are probably better than 2 these days. It is true that many game developers are stuck in the 2 heavy-weight threads model, but they still have other threads involved so having more than 2 helps them. The latest generation of games on console are working towards 4 heavy-weight threads, in which case quad-core is a better match. \$\endgroup\$ – Chuck Walbourn Jul 14 '14 at 16:05
  • \$\begingroup\$ A good overview except for the last bit. Intel's caches (besides L1/2) are shared between all cores, so 4MB cache is significantly worse than 6MB regardless of the number of cores. Yes, 4 cores accessing memory with a 6M cache will have more cache misses than 2 cores accessing memory with a 4M cache, but that's because it's doing twice as much work! \$\endgroup\$ – bcrist Jul 14 '14 at 17:12
  • 1
    \$\begingroup\$ With respect to game development, you may find this article useful (it's a little dated, but still relevant): Coding For Multiple Cores on Xbox 360 and Microsoft Windows, \$\endgroup\$ – Chuck Walbourn Jul 14 '14 at 18:37

Not the answer you're looking for? Browse other questions tagged or ask your own question.