3 ms·
One really nice thing about Rust's use of Arc is that you don't need to bump atomic references in a hot loop, or much at all usually. Once you have an Arc<T> y
by insanitybit 4y ago
One really nice thing about Rust's use of Arc is that you don't need to bump atomic references in a hot loop, or much at all usually.
Once you have an Arc<T> you can `as_ref()` to get a &T. So maybe you need an Arc to share something with another thread, so you clone it once. Once you're in that thread though you can go back to just using `&` and never touch the atomic again.