[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Erlang implementation fun...



"Steven Shaw" <steven_shaw@iprimus.com.au> writes:

> Does Erlang take advantage of multiple processors? Do you need to run
> multiple erlang interpreters to do that?

No and yes.

Pekka Hedqvist and Tony Rogvall did a research implementation that
used multiple CPUs, but this hasn't made it into the main Erlang/OTP
system that we use for real programs.

> I got the impression from the Erlang website that threads in Erlang don't
> share state and that so all communication is through message passing. Is
> this correct? Does this mean that Erlang isn't suitable for building
> information applications (that require data caching)?

Well, the high level semantics are that nothing is shared, but since
there are no destructive updates a lot flexibility is left to the
implementation.

The standard implementation uses a shared heap for binaries (a
datatype for chunks of binary data, kinda like a char*), but separate
actually-copy-on-send heaps for everything else.

There is a ./configure option in recent releases to use a new unified
heap garbage collector developed by the High Performance Erlang (HiPE)
group at Uppsala university. The HiPE page is
http://www.csd.uu.se/projects/hipe/

Cheers,
Luke