shared memory in Erlang

David Gould <>
Wed Jan 31 02:56:35 CET 2001


On Tue, Jan 30, 2001 at 05:30:36PM -0800, Jim Larson wrote:
> 
> It sounds like what's *really* desired here is a multiprocessor-friendly
> implementation of Erlang, so that a single Erlang node could use
> several CPUs on an SMP at once.


Hmmm. What would be the benefit as opposed to multiple nodes on one SMP?
Semantically Erlang makes it reasonably easy to ignore the node a process is
on. So, presumably it would be a performance issue?

But, since Erlang does not have large shared datastructures like a db engine,
and would not let processes directly share them anyway, where is the
performance gain of MP friendly Erlang going to come from?

Message passing?

More control of scheduling?

Something else?

The only one that comes to mind is message passing, in which case
it would be possible to do a shared memory transport (as I think you
mentioned doing).

But any kind of sharing on an MP is going to involve some amount of
overhead for spinlocks and other sychronization. This can eat most of the
gains of an MP pretty fast. And MP friendly programs are much harder to
debug for some kinds of bug.

 
> (In fact, Erlang is probably a
> nice fit to NUMA architecutres too, not just SMP.)

I like this thought. Traditional MP programs are too tightly coupled
to take good advantage of an MP. So they end up getting revamped with
separate zoned memory allocators, and local copies of stuff. And lock
contention becomes an even uglier headache than on an MP.

Erlang, not being coupled at all, avoids all this, but presumably can
take advantage of the low latency message that could be built for nodes
on a NUMA.

-dg

-- 
David Gould                                                 
SuSE, Inc.,  580 2cd St. #210,  Oakland, CA 94607          510.628.3380
You left them alone in a room with a penguin?!  Mr Gates, your men are
already dead.



More information about the erlang-questions mailing list