Erlang & Hyperthreading

Thomas Lindgren <>
Tue Feb 28 14:09:43 CET 2006

--- Ryan Rawson <> wrote:

> As for performance - surely on a multicpu system
> with a SMP aware
> erlang running, one can expect better performance
> just by using
> multiple kernel threads and gaining the ability to
> run on several
> CPUs?  Actual performance on a single cpu, I
> wouldn't expect any
> performance benefit.

There is the extra cost of locking access to shared
data inside the VM; contention between threads;
waiting for sequential, global background tasks like
memory management [parallel GCs exist, though; not
sure what OTP uses], etc. 

These problems are not specific to Erlang, naturally,
but do tend to turn up in most parallel applications,
particularly those that aren't designed to get around
it. Symptoms: First, a multithreaded application on a
single CPU will normally see a slowdown compared to
the single-threaded version (depending on hardware,
language and implementation, the precise number varies
widely). Second, contention and sequentialization
limits potential speedup, both relative to the
multithreaded and the (faster) single-threaded base.

If the application permits it, you could also try a
less convenient and less flexible solution: running
several distributed erlang nodes on the same SMP host.
Since the nodes run at arm's length, the performance
trade off is different.


Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 

More information about the erlang-questions mailing list