[erlang-questions] Re: data sharing is outside the semantics of Erlang, but it sure is useful

Robert Virding rvirding@REDACTED
Mon Sep 14 22:17:36 CEST 2009


2009/9/14 James Hague <james.hague@REDACTED>

> > really want is to have a gb_trees:insert function that...
>
> I meant gb_sets.  Something like gb_sets:add_shared(Term, Set).
>

I am missing something here. gb_sets (nor sets, ordsets, rbsets) does not
make a copy of the data which is put into the set. All that is copied is
enough of the *tree* to insert the new element. There is no need to copy the
new data as it is kept within the same process. Only ets makes a copy of the
data.

Robert


More information about the erlang-questions mailing list