5 ms·
I don't think there is really a distinction here. Swift uses atomic reference counting. Granted the details are different between approaches (swift tries to eli
by celeritascelery 4y ago
I don't think there is really a distinction here. Swift uses atomic reference counting. Granted the details are different between approaches (swift tries to elide references counts when it can), but there are not two different "arcs" being discussed here, they refer to the same concept.
- tsimionescu 4y agoAtomic references counting is a necessary technology when you want to do reference counting for an object shared by multiple threads. This applies both when doing manual reference counting (Rust's Arc, C++'s std::shared_ptr) or when doing automatic reference counting (objects in Swift, Objective C, Python). Choosing to use automatic reference counting in a language is a design choice, with positives and negatives. Atomic reference counting is an implementation detail, a strict necessity whenever you can't be sure an object will only be referenced by one thread (in essence, non-atomic reference counting is just an optimization).