-
What is std::sync::Arc and how does it differ from Rc? |
Beta Was this translation helpful? Give feedback.
Answered by
Tvenus
Jul 15, 2024
Replies: 1 comment
-
std::sync::Arc is an atomic reference-counted smart pointer for thread-safe shared ownership. Unlike Rc, Arc can be used across multiple threads because it uses atomic operations to manage reference counting, ensuring safety in concurrent contexts. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Omokami
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
std::sync::Arc is an atomic reference-counted smart pointer for thread-safe shared ownership. Unlike Rc, Arc can be used across multiple threads because it uses atomic operations to manage reference counting, ensuring safety in concurrent contexts.