<div dir="ltr"><br><br><div class="gmail_quote">On Tue, Apr 20, 2010 at 11:25 PM, Shlomi Fish <span dir="ltr"><<a href="mailto:shlomif@iglu.org.il">shlomif@iglu.org.il</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hi all!<br>
<br>
I once read that in order to truly take advantage of having multiple cores on<br>
the same CPU, then one needs to use several threads. On the other hand some<br>
people assume or implied that if your application splits the work among<br>
several processes, then it can also take advantage of multiple cores. So my<br>
question is: can several distinct processes each execute in their own cores?<br>
<br>
>From my experience with benchmarking <a href="http://fc-solve.berlios.de/" target="_blank">http://fc-solve.berlios.de/</a> , I've<br>
noticed that multi-processing was a bit faster than multi-threading on my<br>
P4-2.4GHz machine ("hyperthreading") while multi-threading was faster than<br>
multi-processing on my Intel x86-64-based laptop with two cores running in<br>
x86-64 mode. It's possible that the multi-tasking in both cases is sub-<br>
optimal, but I've ran the same programs on both computers.<br>
<br></blockquote><div><br>Intel's hyper-threading makes your system THINK you have two cores; It's actually one core, capable of doing the same amount of work. If your program is multi-process/thread it will perhaps have a slight advantage due to this because of how schedulers work (and what's done at "idle" cpu time), but on a single process, I believe it only makes it worse. I turn it off on Intel machines I manage...<br>
<br>All in all, when HT does manage to add something to performance, benchmarks have shown that it's pretty much negligible. On the past few years, Intel dumped this "technology" due to that fact (I guess). Lately they've returned it (to i* CPUs), and I have no idea why.<br>
<br>If you want something that runs fast on multi-threads/processes, get a machine with true multi processors ! :) (and yes, multi-core on one chip certainly counts and sometimes even better in terms of performance than multi-CPU - especially if the CPU supports a shared cache between the cores and your processes does not have affinity to a specific core...). Of course that when you want to build a million-CPU box, sometimes you HAVE to multi-CPU ;) AMD recently announced a 12 core chip that is basically what Intel did in Pentium D - two 6 core "glued" together. Throw 4 of these on a 4 socket motherboard, and you have a 48-CPU supercomputer in one box. Nice, isn't it? :)<br>
</div></div><br>-- Shimi<br></div>