News for hackers. Stuff that matters.
Re:Persistent Data Structures for Objective-C by raspasov on Friday November 07, 2014 @01:01PM (#8573741)
Persistent data structures utilize structural sharing, meaning that the current version of the structures shares as much from its tree as possible with old versions. This effectively allows any thread to make a new version of the data structure efficiently and without having to use locks for reading. They are very useful in the face of concurrency and multiple reader/writer threads.

One thing to remember is that getting a new version of the data structure does not change old ones at all. In order to change state, in Clojure for example, you use constructs such as atoms to "advance" a persistent data structure forward. Think about it like advancing through your git commit history - efficiently and by only applying the delta for the next "change".

There are no comments on this comment yet.