About Multi-cores and Multi-tasking

About Multi-cores and Multi-tasking

shimi linux-il at shimi.net
Tue Apr 20 23:47:41 IDT 2010


On Tue, Apr 20, 2010 at 11:25 PM, Shlomi Fish <shlomif at iglu.org.il> wrote:

> Hi all!
>
> I once read that in order to truly take advantage of having multiple cores
> on
> the same CPU, then one needs to use several threads. On the other hand some
> people assume or implied that if your application splits the work among
> several processes, then it can also take advantage of multiple cores. So my
> question is: can several distinct processes each execute in their own
> cores?
>
> >From my experience with benchmarking http://fc-solve.berlios.de/ , I've
> noticed that multi-processing was a bit faster than multi-threading on my
> P4-2.4GHz machine ("hyperthreading") while multi-threading was faster than
> multi-processing on my Intel x86-64-based laptop with two cores running in
> x86-64 mode. It's possible that the multi-tasking in both cases is sub-
> optimal, but I've ran the same programs on both computers.
>
>
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...

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.

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? :)

-- Shimi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.cs.huji.ac.il/pipermail/linux-il/attachments/20100420/1205291f/attachment.html>


More information about the Linux-il mailing list