I see a lot of people here saying something like "Just use Arc<Mutex>, it will be plenty fast".
As someone who does it all the time, I noticed that code becomes less readable and hard to comprehend that way. Important types stand much less out in function signatures once you have Arc<Mutex<InterestingType>>. Rust is already extremely verbose and adding additional layers to types doesn't help. Not even to mention that now every time you want to access the value you need to do dance with calling .lock().
Rust pro tip: use type alias.
As for using lock() - you'd have to do it in any language in some way. If you have sharing and mutability, you need some kind of synchronization.
You don’t need full synchronization if you’re not going cross threads. RefCell and the like don’t use atomic operations or barriers or anything fancy like that.
As someone who does it all the time, I noticed that code becomes less readable and hard to comprehend that way. Important types stand much less out in function signatures once you have Arc<Mutex<InterestingType>>. Rust is already extremely verbose and adding additional layers to types doesn't help. Not even to mention that now every time you want to access the value you need to do dance with calling .lock().