[erlang-questions] Sharing data by reference
Mon Mar 30 11:55:20 CEST 2009
> I read in this post
> that compile time constants are in constant pool and are used by reference in
> each process. This works well for compile time constants. What about the the
> run-time constant, for example configuration read from the file. This
> configuration remains constant through-out the life time of the VM. Is it
> possible to put that in the constant pool and have a reference to it in each
> process instead of copying around?
I believe binaries are treated this way.
If you keep references to the binary (read from file) then all of the state objects with a "copy" of the binary refer to the same immutable data. One copy.
Enjoy a better web experience. Upgrade to the new Internet Explorer 8 optimised for Yahoo!7. Get it now.
More information about the erlang-questions