These are chat archives for rust-lang/rust
Sendis something you can move into another thread (via
thread::spawn, for example).
Syncis something that can be shared by reference (via
crossbeam::scope, for example).
Vec<u8>: although accessing
Vecfrom two threads concurrently is not save,
Veccan cross boundaries between threads if you completely move it from one thread into another.
Rc<u8>: if you clone
Rcand send it to another thread, than two threads will be able to concurrently update non atomic reference count.
Cell<u8>: if you share a reference between two threads, then they can concurrently mutate the contents of the
Cell, so this is disallowed. However, if you transfer the ownership from one thread to another then the race becomes impossible.