Hacker News new | ask | show | jobs
by tomp 1544 days ago
> This is especially bad if you want the data structure to be shared across multiple threads. Just iterating over a tree now requires taking and releasing oodles of locks.

Um, what?

Persistent data structures don't require locks at all (because they're immutable), in fact using them in a multithreaded way is 100% safe and thus much easier than their mutable (and ordinarily more efficient) counterparts.

1 comments

Refcounted gc means you need locking on refcounts or you can lose your tree during iteration.
Can you provide a list of reference-counted functional languages?