4 ms·
Yes; data structures are immutable in Erlang, so the runtime system can share them (and their substructures) freely amongst its threads.
by kd5bjo 9y ago
Yes; data structures are immutable in Erlang, so the runtime system can share them (and their substructures) freely amongst its threads.
- sb8244 9y agoI don't believe everything is shared like this. Anything smaller than 64 bytes is copied around to different process stacks. https://hamidreza-s.github.io/erlang%20garbage%20collection%20memory%20layout%20soft%20realtime/2015/08/24/erlang-garbage-collection-details-and-why-it-matters.html https://hamidreza-s.github.io/erlang%20garbage%20collection%... Is a great post
- deleted 9y ago[deleted]
- toast0 9y agoBEAM does not share structures like this. It would make garbage collection much harder. Immutability and shared nothing makes the GC simple. You couldn't compact a process heap if parts of it were in use by other processes.