this post was submitted on 23 Aug 2023
17 points (100.0% liked)
Rust
7083 readers
9 users here now
Welcome to the Rust community! This is a place to discuss about the Rust programming language.
Wormhole
Credits
- The icon is a modified version of the official rust logo (changing the colors to a gradient and black background)
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Is the Singleton accessed by one thread or many?
If it's one thread, couldn't you just wrap the
Vec
in anRc
and then clone your singleton every time you need it in a new scope?If it's many, you should use channels and a dedicated logging thread imo.
One for now, theoretically many later.
Nice I've never used Rc. Maybe now's my chance to look into it.