[erlang-questions] Parallelism, SMP, and multicore question

Edwin Fine <>
Tue Sep 2 19:09:56 CEST 2008


Since the cognoscenti are talking about parallelism, maybe someone can
answer something that has been perplexing me.

Sometimes it has been measurably faster on a multicore system to run one VM
per core, each with SMP disabled (or +S 1), than it is to run one or more
SMP VMs. This is true even when running code that is innately parallel. On
the other hand, I have seen benchmarks that show near-linear speedups using
SMP.

I don't have code to support this; it's just something I, along with a
couple of other people -- for whom I don't want to speak -- have noticed in
passing.

Does anyone have any insight into the internals of SMP who can tell me when
SMP might be an asset, and when a liability? I know this is a "how long is a
piece of string" question, but even though it's pretty general, someone
somewhere who really knows Erlang inside out (i.e. not me) must surely have
encountered this phenomenon.

Are there conditions where contention between the threads of the SMP
processes (e.g. mutexes) becomes significant enough that multiple separate
non-SMP VMs perform better? If so, what would those conditions be?

Could it have anything to do with the mix of CPU-bound processes and
inter-process messaging or network I/O? If so, please could someone explain
the mechanism?

Anyone?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20080902/e1b38b19/attachment.html>


More information about the erlang-questions mailing list