Sync lets values be shared behind immutable references. See this example with
Arc: https://play.rust-lang.org/?gist=cb332bcd2eb8a23c3b44&version=stable. Doing an explicit deref of the Arc only gets you an immutable pointer to its interior.
So if you put a
Box in an
Arc you can't get a mutable pointer to the
Box - it is 'frozen'. This is what allows immutable data to be shared trivially.
The magic then that allows
Sync things to be mutated is 'interior mutability'. Interior mutability provides a way to mutate things behind 'immutable' (i.e. shared) references.
In a concurrent setting, e.g.
Mutex can be used to provide exclusive mutable access to a value. So to mutate a shared box you put a
Box in a
Mutex in an