[gclist] Re: gclist-digest V3 #84

Richard A. O'Keefe ok@atlas.otago.ac.nz
Thu, 22 Jun 2000 15:10:16 +1200 (NZST)


I wrote:
    Surely Erlang can't be the only system with a per-thread heap?
Charles Fiterman <cef@geodesic.com> replied:
    Erlang must be a functional language otherwise you'd have inter heap
    pointers. 

Yes it is a functional language, but the reasoning is invalid.

Functional language doesn't entail no inter-heap pointers:
    Erlang processes communicate by sending each other messages;
    those messages _are_ copied, but they _could_ have been shared,
    resulting in inter-heap pointers.

No inter-heap pointers doesn't entail functional language:
    You could have an imperative language where multiple processes
    each have their own heap, but data values are not shared.

The crucial point is about Erlang is not what the base language looks
like, but that *all* communication between processes is either
by means of 
    - shared pointers to objects that are known to contain no cycles
      (so the shared heap can use reference-counting with prompt release)
    - or COPYING message-passing.
That's a good recipe for staying out of concurrent trouble anyway.