What do i use to share an object with many objects and one writer?


#1

Hi!

I am wondering what the right approach might be, to share a common object between many tasks, which may be written by one owner sometimes. Currently i try to create one Configuration trait object with several methods to get and set config keys. Later i’d like to pass this to other objects and tasks where configuration items may be read. Bonus point would be that it can be written and read from everyone. I’ve found http://www.reddit.com/r/rust/comments/240mfe/design_question_about_shared_mutable_data/ which talks about Rc<RefCell<>>, so i that would be the right way?


#2

Please ask questions about how to use Rust on Stack Overflow. This forum is for discussion of the development of Rust itself.


#3

Oops… http://stackoverflow.com/questions/27359586/what-do-i-use-to-share-an-object-with-many-objects-and-one-writer-in-rust