4 ms·
But one of the advantages of Rc is to allow for dynamic GC-like lifetimes, where values have no clear owners.
by afiori 8y ago
But one of the advantages of Rc is to allow for dynamic GC-like lifetimes, where values have no clear owners.
- Jweb_Guru 8y agoYes, we are in agreement about that. But they are certainly not necessary for shared data structures (even concurrent ones) and that is what the post to which I was responding said. This also isn't a purely pedantic point; scoped threads and libraries like Rayon are explicitly designed to allow concurrent sharing of values where the sharing has a bounded lifetime, and they do not require reference counting in order to support this (indeed, some usecases of these libraries, such as splitting up arrays into disjoint slices, don't really work with reference counting).