[erlang-questions] Re: Shared/Hybrid Heap
Wed Oct 13 12:24:31 CEST 2010
Clearly, there is a case for both shared and copied data structures.
It depends on the access patterns.
If each process needs to access the data structure a lot, it is faster
with copies, and vice versa.
This could be true for read operations as well. It is not true, that an
immutable, read only, data structure should always be shared. The reason
is locality (cache misses, time of far away memory access etc.).
I don't think it is possible to have the virtual machine solve this
correctly in all cases. Only the programmer knows the future use of the
data, except for very small programs, maybe.
So this leads to the following proposal.
Erlang processes should have internal threads.
The programmer decides between spawning a process or a thread. Processes
share almost nothing, threads almost everything.
I am not saying Erlang should go that way, but it seems to be the
solution to this issue.
On 10/13/10 11:26 AM, Svatopluk Šperka wrote:
> Well, I believe there is a whole spectrum of software systems and
> although actor model is most natural model of computation I know, in
> its pure form it seems to be applicable only to a limited part of the
> spectrum - for practical reasons.
> For example data-intensive systems where there is huge amount of data
> managed by different processes and you need to compose results from
> different processes into a final result, pure share-nothing semantics
> is expensive, really expensive in terms of memory consumption and even
> CPU cycles.
> If you allow data to be shared by processes and its done behind the
> curtain by runtime, there's practically no difference for programmer,
> whole system just has different properties. What properties change and
> how is a complex problem, but I don't think it would be worse from all
> Strict share-nothing is probably best choice for what Erlang is
> originally aimed for. But not best for everything.
> Svatopluk Šperka
> On 10/12/10 2:10 , Steve Davis wrote:
>> "progress"? how would this be "progress"?
>> On Oct 11, 7:02 am, Svatopluk Šperka<spe...@REDACTED> wrote:
>>> does anyone know if there's any progress concerning shared/hybrid heap
>>> in Erlang ?
>> erlang-questions (at) erlang.org mailing list.
>> See http://www.erlang.org/faq.html
>> To unsubscribe; mailto:erlang-questions-unsubscribe@REDACTED
> erlang-questions (at) erlang.org mailing list.
> See http://www.erlang.org/faq.html
> To unsubscribe; mailto:erlang-questions-unsubscribe@REDACTED
More information about the erlang-questions