Conclusion

Writing multithreaded code means much higher software development costs while CPU development gets easier and thus cheaper (compared to even more complex superscalar CPUs). No wonder that the CPU developers are very motivated to hype the multi-core route, but the software development community is probably less enthusiastic.

Intel and other manufacturers should not simply push the costs of getting higher performance onto the software developers. Because, in the end, it will be the consumer who will pay the final price: either more money or buggier software with more crashes and hangs. One way that Intel and others can help to keep multithreaded development costs under control while offering increasing CPU performance is to keep investing in ILP and thus higher IPC cores; another option is to improve the interCPU communications.

The easiest part of multithreading is using threads that are running completely independent, that don't share any data. But this source of threading is probably already being used almost to the fullest. In order to tap into a new source of multithreading, such as the largely unused potential of multithreaded AI, Phyics and animation, it is important that developers don't have to worry about interthread messaging and synchronization lowering performance.

Very fast interprocessor communications to make sure that thread synchronization comes with little overhead will give a bigger incentive to developers to invest the extra time in multithreading.

Gabriele Svelto:[4]
"Most of the current multi-threaded software is developed with an eye at keeping inter-thread messaging and synchronization as low as possible because both have a significant cost. This cost will be lowered by an ordered of magnitude by multiple cores on a single die giving in turn more flexibility for the programmers.

Applications which got low speed-ups by going multi-threaded due to the overhead of fine-grained locking mechanisms will be able to exploit multiple-processors with fast interprocessor communications much better."
The Pentium-D and Pressler are examples of how not to do it: just slap two CPUs on the same die and call it a day. High clocked single cores like the upcoming Athlon 64 FX-57 will eat these massive chips for lunch in almost all benchmarks while consuming less energy. With the exception of some special far-fetched benchmarks, it will be pretty hard to justify the reason behind these dual cores.

Luckily, Intel's Yonah and AMD's Dual Athlon 64 cores show that better multi-core CPUs are on the way. At that point in time, we are entering the multi-core engine for real. And we can only applaud that because it unleashes a massive amount of CPU power upon the developers.

References

[1] Intel multi-core briefing
Stephen L. Smith, Vice President Digital Enterprise group, IDF Spring 2005

[2] Unreal 3 engine
http://www.unrealtechnology.com/html/technology/ue30.shtml

[3] Galactiv Cilivisations
http://www.galciv.com/index.asp?c=1&u=0

[4] Gabriele Svelto on dualcore CPUs
http://www.aceshardware.com/forums/read_post.jsp?id=20270&forumid=2

Threads & Gaming
Comments Locked

49 Comments

View All Comments

  • NullSubroutine - Monday, March 14, 2005 - link

    I think there is a few things that most people overlook when looking at multi-cpu/multi-core, almost all benchmarks that I have seen are written and tested on systems with clean installs, and have no other programs running (anti-virus, aim, msn, teamspeak, IRC, p2p software, firewall, decode human genome :b, etc). I would think that most people do leave many programs open, such as those above, when playing games.

    With this in mind, people will find an increase of system performance when leaving multiple programs running. It wont be an increase for performance for benchmark testbeds so much, as an increase in real world performance.

    So basically it won't increase speed in these circumstances, but limit the decrease of fps while running many different programs.
  • fitten - Monday, March 14, 2005 - link

    Article: "Be warned that Intel was already showing performance increases, which are not realistic "up to 124%"."

    #5, there's another explanation as well, but it's a more rare condition. Suppose you had two processors (doesn't even have to be dual core), each with 1M L2 cache. Suppose you also had a problem that has data that is 1.5M in size and is very coarse grained (very parallelizable). One processor cannot fit all the data into L2 cache so it will have to run at main memory speeds most/all of the time. With two processors, each gets 768K, which can easily fit into its L2 cache, which enables each processor to run at L2 cache speeds. This would show up as a superlinear speedup (two cores = more than 2X as fast). This is an extreme example, but one I expect to find in published marketing propaganda.


    #13 " A though! I still think threads are rubbish, that processes and better schedulers are the way forward. "

    Well, with threads you get shared memory for "free", if you've ever written processes that use shared memory, well, there you are. However, since a threaded kernel and a process based kernel are pretty much the same when a process has only one thread, there's little difference between the two for single-threaded executables and you can continue to use your multi-process model without any problems.

    As with #17... like it or not, multi-core/multi-processor boxes are what's coming. You can choose to use what resources are available to you or you can stick to one process programming. Some groups will choose to use what resources are available and some won't. The marketplace will sort out the winners/losers based on which solution is better.

    #18 The PPU is just another form of multiprocessing (just like GPUs are). It's just Asymmetric Multiprocessing (AMP) instead of Symmetric Multiprocessing (SMP). It's not new or anything. I do agree, though, that the PPU has a lot of potential and, just out of my own preferences, goes by the idea that adding specialized hardware (cheaply) usually is a bigger win than adding more generalized hardware. Just think of graphics cards today. Adding a relatively cheap graphics card will make your game run much better/prettier than adding another P4 or Opteron.

    Basically, my thoughts are this: The gaming industry has already gone "multi-threaded" in an asymmetric way simply because of 3D video cards. They already have solved some problems by abstracting parts of their problem. This is simply adding more resources that they can take advantage of, or not, as they see fit. Having dual-core or dual processor systems doesn't prevent them from writing as they've done today. The main issue, for the short term, is that they will need to know whether or not they are on a dual core machine and write accordingly. The main reason that multithreaded games haven't really caught on as of yet is because 99% (or more) of the target audience has only one core. Spending the amount of time/effort to optimize for dual processors for less than 1% of your target market doesn't make sense. If 90% of the market had dual processors, then it would probably be worth the effort to plan to use the resources available. Since both major CPU houses are going dual core and it looks like that's the "way it's gonna be", there will be a rocky period for a while while dual core machines are rare, but they will get more common until the point where they are in the majority. At that time, it will make sense to consider single core machines as the degenerate case and, basically, make single cores the exception instead of the rule.
  • Calin - Monday, March 14, 2005 - link

    #20, a multicore implementation could have shared cache, and also have very fast inter processor communications. You could write a program with small interdependent threads that wait to end both and update parts of some common data. The data used stays in the common cache, and every update is made extremely fast.
    Compare this to a dual processor, that must maintain its caches in synchronization. After a fraction of a millisecond (or less) or work, the processors update different portions of the common data. And there goes: invalidation of cache lines, writing of modified cache lines to memory, the processors must fight for a single FSB (the case with Intel Pentium processors), and so on. You can see that there are some cases (even if somehow artificial) when a proper implementation of dual core can be much faster than multiprocessor.
    The best advantage the multicore will have over multiprocessor would be in numerical tasks like weather prediction, and other highly interdependant computation tasks
  • hzmonte - Tuesday, October 4, 2005 - link

    "a multicore implementation could have shared cache and also have very fast inter processor communications... Compare this to a dual processor, that must maintain its caches in synchronization." Is this the real reason that multi-core multiprocessing is better than multi-chip multiprocessing (the traditional SMP)? A multi-core chip can have dedicated caches (per core) too, and that requires synchronization. And multi-chip SMP could also have shared cache and fast inter-chip communication. Well, you may argue that it is easier to make inter-core communication faster than inter-chip communication. But is this really the fundamental reason why multicore is better than multichip? Could someone explain why a processor manufacturer and a consumer would prefer making/buying a multicore than multichip processors? As far as power consumption and leakage is concerned, isn't it true that multichip is more manageable? In a paper "Planning Considerations for Multicore Processor Technology" by John Fruehe (May 2005) in dell.com/powersolutions, the author compares the effective performance level of a multicore and multichip processors. (But he does not address my question.) Without giving reason, he assume that the core-to-core scalability is 70% (that is, the second core delivers 70% of its processor power due to overhead) whereas the estimated socket-to-socket (i.e. chip-to-chip) scalability is 80% (that is, the dual processors achieve 180% of their combined processing power). That is kind of interesting. I really want to see a comparison between multi-core multiprocessing vs. multi-chip multiprocessing.
  • ksherman - Monday, March 14, 2005 - link

    at80eighty, by sexy, I mean SCARY AS ALL FREAKIN REASON!!! ;-)
  • Calin - Monday, March 14, 2005 - link

    High IPC is not the form of parallelism from the article - the focus of the article was on running a process on two (or more) different cores. The idea is that high IPC profits all the programs, no matter how written. Multi thread is different - the idea is to have parts of a program that execute simultaneously but with very few interrelations (you can have a thread to paint the interface in a game, while having another thread to paint the rest of the screen. The threads would be with almost no correlations (except for sending commands).
    High IPC is not a solution in x86 world because the code tends to have dependencies close to each other, so you can start executing 100 instructions at a time, but 99 of them needs to wait for the execution of one. You simply have those moments when all execution must wait for an instruction to end.
    EPIC (Itanium) will help with that, as the high IPC could be guaranteed by the instructions - at every clock you can execute one instruction = equivalent to several x86 instructions. So, the performance would be the clock speed multiplied by an IPC of 3 or 4, unlike the Athlon (let's say) that have a performance generated by its larger clock speed multiplied by 1 IPC or something.
  • Kensei - Monday, March 14, 2005 - link

    Wonderful article! I loved the "hardware meets software" focus of this piece. I've had many questions about the practicality of multi-threaded applications and this article answered many of them. Also, loved the interview with Sweeny.

  • bob661 - Monday, March 14, 2005 - link

    #9
    I am offended by the word "steam".
  • Matthew Daws - Monday, March 14, 2005 - link

    #20:MarriedMan - Yes, I think so. This is actually an interesting question. As I understand it, I think both AMD and Intel are using pretty much the same technology in both, so that communication channels on the motherboard (in the dual CPU case) will be replaced by communication channels on the CPU die. I think AMD's approach is better only because HT etc. lends itself to dual-core much better than Intel's older technology. I guess the next generation of dual-core chips might be somewhat different though. Anyone else know anything?
  • MarriedMan - Monday, March 14, 2005 - link

    I assume that when a program is multi-threaded to take advantage of dual core CPUs, it will automatically take advantage of dual CPU systems as well.

    Is that a correct assumption? Will the Unreal 3 engine use multiple single core CPUs on an MP system?

Log in

Don't have an account? Sign up now