[erlang-questions] Re: Shared/Hybrid Heap

Anthony Shipman als@REDACTED
Fri Nov 5 10:09:19 CET 2010


On Thu, 4 Nov 2010 05:34:46 pm Jeff Schultz wrote:
> On Wed, Nov 03, 2010 at 10:47:05PM -0400, Ryan Zezeski wrote:
> > What is wrong about using a mutable data structure that can only ever be
> > touched by _one_ and only _one_ process?  Then, if this process wants to
>
> Well, mutability may impose a significant cost on all but the simplest
> garbage collectors, and part of that cost will be paid even if nothing
> mutable is being mutated.  Whether this is a net performance gain or
> loss will vary with the circumstances, but it's not an inevitable win.
>
> The extra complexity may also lead to more, usually nasty, garbage
> collection bugs.
>
>
>     Jeff Schultz

If I were designing an erlangish language I would enrich the binary pattern 
system to look more like C data definitions. Then I could have a mutable 
binary that is accessed through the C-like pattern for reading and writing. I 
could then have a reasonably efficient image buffer. There would be no 
possibility of pointers to other data structures inside such a binary so 
there would be no GC issues. It would be possible to send the binary to 
another process but the sender would lose access to it.

-- 
Anthony Shipman                    Mamas don't let your babies 
als@REDACTED                   grow up to be outsourced.


More information about the erlang-questions mailing list