Assume that I have a computer called A with a processor that has two cores and has hyperthreading, i.e it has 2 cores with 4 threads (I understand that this can supply to 4 processes simultaneously), assume also that I have another computer called B has 2 cores but no hyperthreading, (as I understand it can 2 processes simultaneously supply) now assume that A and B has the same 3.4GHz clock frequency, assume I wrote an algorithm that calculates an average, but I designed the algorithm so that ONLY use two processes, with this in mind, what computer operation finishes first?. (assume that the input is the same, and the only difference between A and B is hyperthreading).

  • Is this homework ? (Not that that's bad, just the way it's phrased reminds me of being in school) – Sirex May 14 '13 at 0:16
  • It depends. But most likely they would finish at the same time. – Matt H May 14 '13 at 0:19
  • 1
    It is not my homework, I tried to be really specific, and I put the question in an understandable way. – guest May 14 '13 at 0:23

As long as Windows avoids the 2 'fake' cores on the hyperthreaded machine, then there will be no difference.

If windows decides to run both threads on cpu0 and cpu1 (the fake one), then this will be a significant performance hit.

I'm having trouble finding reference on the web, but I would imagine that the windows OS is smart enough by now.

The algorithm will be faster on the hyperthreaded machine, if you execute it with 4 threads

| improve this answer | |
  • IMXP, windows throws threads around ALOT. Chances are that on the HT machine, the HT cores will actually get hit for small amounts of time despite windows being smart and aware of real vs fake cores, which could add a minor performance hit. For example, run a max zip job, and you'll see taskmgr using all cpu's quite evenly, no single core ever reaches 100. This indicates context switching at a very high rate.... Linux, behaves much nicer, and sticks a process to one core for much longer periods of time. – Michael May 14 '13 at 3:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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