From: Sylvain Le Gall <sylvain@le-gall.net>
To: caml-list@inria.fr
Subject: Re: SMP multithreading
Date: Wed, 17 Nov 2010 11:34:19 +0000 (UTC) [thread overview]
Message-ID: <slrnie7fdr.r67.sylvain@gallu.homelinux.org> (raw)
In-Reply-To: <8762vwdx09.fsf@frosties.localnet>
On 17-11-2010, Goswin von Brederlow <goswin-v-b@web.de> wrote:
> Sylvain Le Gall <sylvain@le-gall.net> writes:
>
>> Hi,
>>
>> On 15-11-2010, Wolfgang Draxinger <wdraxinger.maillist@draxit.de> wrote:
>>> Hi,
>>>
>>> I've just read
>>> http://caml.inria.fr/pub/ml-archives/caml-list/2002/11/64c14acb90cb14bedb2cacb73338fb15.en.html
>>> in particular this paragraph:
>>>| What about hyperthreading? Well, I believe it's the last convulsive
>>>| movement of SMP's corpse :-) We'll see how it goes market-wise. At
>>>| any rate, the speedups announced for hyperthreading in the Pentium 4
>>>| are below a factor of 1.5; probably not enough to offset the overhead
>>>| of making the OCaml runtime system thread-safe.
>>>
>>> This reads just like the "640k ought be enough for everyone". Multicore
>>> systems are the standard today. Even the cheapest consumer machines
>>> come with at least two cores. Once can easily get 6 core machines today.
>>>
>>> Still thinking SMP was a niche and was dying?
>>>
>>
>> Hyperthreading was never remarkable about performance or whatever and is
>> probably not pure SMP (emulated SMP maybe?).
>
> Hyperthreading is a hack to better utilize idle cpu sub units. The CPU
> has multiple complete sets of registers, one per hyper thread. Execution
> of the threads is interleaved. Now when one thread is doing some
> floating point operation the cpu switches over to another thread and
> lets it do some integer aritmetic. But that assumes the threads are
> using different sub units. If they are using the same unit then they
> just block each other and no speedup occurs.
>
> The speedup of hyperthreading is purely from avoiding dead cycles when
> one thread waits for something. On te other hand the cache is shared
> between threads so per thread it is smaller and more easily
> trashed. Hyperthreading can be much slower too.
>
Indeed, the HT extension was designed to reduce pipeline bubbles, which
most of the time occurs when you need to load data from a slow memory
(slow = RAM as opposed to L1/L2 cache).
In the old time of my P4, ocaml was performing quite well on the
processor. One story about it: while compiling cameleon on it, I often
get into "thermal warning" (the CPU was overheating). I think it could
have been related to the fact the CPU idle level was very low (e.g. no
pipeline bubble). I always thought that this was related to the fact the
minor heap can be stored inside the cache and that reduces the hit/miss
factor (i.e. avoid fetching data in RAM). I have never really tested
this hypothesis. Maybe you can tell me your opinion about this?
Regards,
Sylvain Le Gall
next prev parent reply other threads:[~2010-11-17 11:34 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-15 17:27 Wolfgang Draxinger
2010-11-16 6:46 ` [Caml-list] " Edgar Friendly
2010-11-16 17:04 ` Gerd Stolpmann
2010-11-16 20:35 ` Eray Ozkural
2010-11-16 22:13 ` Gerd Stolpmann
2010-11-16 23:04 ` Eray Ozkural
2010-11-16 23:52 ` Wolfgang Draxinger
2010-11-17 1:55 ` Eray Ozkural
2010-11-17 3:41 ` Jon Harrop
2010-11-17 3:47 ` Jon Harrop
2010-11-17 4:27 ` Eray Ozkural
2010-11-17 6:50 ` Gabriel Kerneis
2010-11-17 13:41 ` Eray Ozkural
2010-11-17 21:15 ` Jon Harrop
2010-11-18 0:28 ` Eray Ozkural
2010-11-18 1:00 ` Eray Ozkural
2010-11-16 19:07 ` Norman Hardy
2010-11-17 16:34 ` David Allsopp
2010-11-19 13:57 ` Eray Ozkural
2010-11-16 12:47 ` Sylvain Le Gall
2010-11-17 11:12 ` [Caml-list] " Goswin von Brederlow
2010-11-17 11:34 ` Sylvain Le Gall [this message]
2010-11-17 23:08 ` [Caml-list] " Christophe Raffalli
2010-11-19 9:01 ` Christophe TROESTLER
2010-11-19 15:58 ` Goswin von Brederlow
2010-11-20 11:55 ` Jon Harrop
2010-11-20 20:57 ` Goswin von Brederlow
[not found] ` <AANLkTinyN2hHxm6ha2Yq4nx6NxY3So=BhFN_-EHKYfyc@mail.gmail.com>
2010-11-16 14:11 ` Wolfgang Draxinger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=slrnie7fdr.r67.sylvain@gallu.homelinux.org \
--to=sylvain@le-gall.net \
--cc=caml-list@inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox