4 ms·
If you make copies of immutable data collections to change state, why not just use message passing? If you're going to share memory, you're more likely to writ
by ndesaulniers 12y ago
If you make copies of immutable data collections to change state, why not just use message passing? If you're going to share memory, you're more likely to write lock free data structures than copy immutable collections around. Supposedly, the point of juggling razors is for speed.
- michaelsbradley 12y agoImmutable collections don't have to be wholly copied – derived collections may share internally quite a bit of information with the original collection/s. That allows them to be both fairly efficient and yet safe when used across concurrent processes. The "tricky party" is when concurrent processed need to synchronize some reference. Facilities for such ops can be orthogonal to the implementation of immutable collections, and then the two can be used together to good effect.
- ndesaulniers 12y agoThat's interesting, I did not know that. While it sounds like a fair amount of work, it can't be too much more than designing lock free data structures. Do you have good references to the design of such structures, or should I follow the links you posted above?
- michaelsbradley 12y agoThis is probably a good start: http://hypirion.com/musings/understanding-persistent-vector-pt-1 http://hypirion.com/musings/understanding-persistent-vector-...