Slashdot Mirror


Dual Cores Taken for a Spin in Multitasking

Vigile writes "While dual cores are just now starting to hit the scene from processor vendors, PC Perspective has taken the first offering from Intel, the Extreme Edition 840, through the paces in single- and multi-tasking environments. It seems that those two cores can make quite a difference if you have as many applications open and working as the author does in the test." It's worth noting that each scenario consists of only desktop applications, and it'd still be interesting to see some common server benchmarks, such as a database or web server.

7 of 221 comments (clear)

  1. Re:Newsflash... by The+New+Andy · · Score: 5, Informative
    ... assuming the OS chooses which threads are executed on which core well enough. If two threads depend on each other heavily and they are running on different cores, you can get really crappy performance.

    So the obvious answer would be to move one of the processes to the other core. However, this isn't trivial. You either have one scheduler per core or one scheduler per operating system. (You can't have a single thread sent to both cores easily - if both cores run the same thing at the same time there will be chaos)

    If you have one per core, then the scheduler trying to get rid of the thread will have to synchronise with the other core, waiting for the other scheduler to come into context, it then has to tell it to add this new process. Obviously, there is a fair bit of overhead, and if my memory serves me correctly, each core in the current chip has its own cache - so now all the stuff which was cached has to be sent to memory (since it is in the wrong cache) and now there is nothing in the cache, making every memory access slow for the next little while. End result - you can transfer a thread between CPUs, but it is costly.

    It is possible to have a single scheduler which can then just dispatch threads to each core as it gets run by each core. The big one here is making the scheduler threadsafe - both CPUs could run the scheduler at the same time, so you have to make sure they don't crap on each other. This is a problem which we have solved already with common synchro-primitives. But, if you just lock the list of threads to run (*), then you will get a whole lot of CPU time wasted just waiting to run the scheduler. It might be acceptable for 2 cores, but it doesn't scale at all.

    (*) You may realise (just as I realised) that a scheduler is more than just a list of threads to run (it is typically implemented as a couple of lists for each priority). The same problem still occurs with more than one list of threads, it is just a bit harder for me to express (proof by bad English skills).

    Finally, I'm expecting someone to tell me that I'm wrong about something I just said. That person is probably correct. My only experience with this stuff is a 3rd year undergrad operating systems course where we played around with OS161 (a toy operating system basically). But, hopefully the end conclusion will be the same: twice the number of processors won't equal twice as much performance, and it is tough to get a fast algorithm that will scale.

  2. Anandtech by iamthemoog · · Score: 5, Informative

    Has the new dual core opteron up against a quad Xeon with 8MB cache, amongst many others.

    Well worth a read:

    http://www.anandtech.com/cpuchipsets/showdoc.aspx? i=2397

    --
    No Norm, those are your safety glasses; I'll wear my own thanks...
  3. Re:Well... by tomstdenis · · Score: 4, Informative

    AMD64 carries more than just "bigger registers". It has more of them and the actual core is an overall improved K7 process with

    - Slightly longer scheduling buffers
    - 128-bit L1 cache bus
    - Larger instruction window (means it can feed the alus better when constants/etc are found)
    - more registers [and they're bigger]

    They also run cooler and takes less power than their k7 brothers.

    Tom

    --
    Someday, I'll have a real sig.
  4. Re:Well... by JollyFinn · · Score: 4, Informative

    The 64bit is for anyone with more than 2Gb of RAM + x86-64 gives you more registers besides being 64bit so it speeds up the recompiled code.

    Dual core means simply you have TWO processors running. Rember old reviews on SMP dual celeron A and other such reviews. It gives little for games, lots for certain multithreaded applications. As you have two processors running and doing things. And multitasking applications, like being able to run interactive application (doom 3), while system is doing some multihour compilation on background.
    Anyway, it mainly keeps system more responsive when you have some thread or application takes CPU.
    Also with lesser degree helps in some other similar situation, where CPU is tied up with something EXACLY same moment you would wan't it to deal with UI stuff.

    --
    Emacs is good operating system, but it has one flaw: Its text editor could be better.
  5. Re:Well... by tomstdenis · · Score: 4, Informative

    .... Me work for AMD? Ha!

    No, I'm just a happy loyal user. I have both a Prescott P4 3.2Ghz and an AMD64 Newcastle 2.2Ghz...

    For what I do [building software] the AMD64 smokes the P4 ... and does it without getting to 50C or so...

    The AMD approach is just common sense. Be more efficient at what you do and gradually do it faster. Intel went the market route and said "slow clockrate is for pansies!".

    So you end up with a cpu that has a higher clock rate but it doesn't win because the efficency is too low.

    AES on my AMD64 ranges around 260 [or so] cycles/block. On the P4 with Intels compiler I get around 410 cycles/block. If you scale 3.2Ghz to 2.2 Ghz that's still effectively 281 cycles [at 2.2Ghz]. Doesn't seem like much but keep in mind to get this speed they had to draw more power and run at a higher clock rate.

    I did a benchmark a week ago where I built LibTomCrypt with/without hyperthreading and it took the prescott with hyperthreading at 3.2Ghz to even come close to matching the AMD64 speed. That's only on ~45,000 lines of code.

    Now multiply that by say five or ten to get a larger project.

    I'm not saying the Prescott isn't a neat design. Overall it's efficient enough to be useful. Just the AMD64 eats it's breakfast and spanks it's mother is all I'm saying. ;-)

    Tom

    --
    Someday, I'll have a real sig.
  6. shared FSB (intel) or not (AMD); other benchmarks by coats · · Score: 4, Informative
    After reading the article, I realised that the frontside bus was shared. I didn't expect that. It seems to be a transitory solution in order to have the "first dual-core" CPUs on the market. When AMD releases theirs I expect them to have a superior solution.
    AMD64 has had the circuitry for dual-core on-chip memory controllers from the very first -- they just didn't have the second CPU core. For a good discussion of the differences, see http://www.linuxhardware.org/features/05/04/21/174 7217.shtml at LinuxHardware.

    For benchmarks relating to serious DB and web use, see this review by Anand Shempi: http://www.anandtech.com/cpuchipsets/showdoc.aspx? i=2397 or these two at FiringSquad: http://www.firingsquad.com/hardware/amd_dual-core_ opteron_875/ and http://www.firingsquad.com/hardware/colfax_dual_op teron/

    --
    "My opinions are my own, and I've got *lots* of them!"
  7. Re:Newsflash... by dascandy · · Score: 4, Informative

    Actually, the opposite. Two processes that communicate quite heavily SHOULD be run together on two processors, especially since they will share memory and thus cache lines, plus they can spend time spinning on a lock instead of swapping threads. Given short locks and equal speed, they can work a whole lot more efficient on a dual-core than on a single-core.

    FYI, it's called Gang Scheduling and has been described for quite some time.