3 ms·
Interesting read would be here: http://doc.rust-lang.org/std/thread/ http://doc.rust-lang.org/std/thread/ It is also guaranteed by ownership system: in the saf
by nercury 12y ago
Interesting read would be here: http://doc.rust-lang.org/std/thread/ http://doc.rust-lang.org/std/thread/
It is also guaranteed by ownership system: in the safe mode (which is default) rust will statically (at compile time) ensures that a value can only be mutated at a single execution point. It is done by moving, instead of copying any value _by default_, unless it is wrapped in some kind of synchronization primitive or implements a _Copy_ trait.
Synchronization primitives themselves are implemented in unsafe mode, thus limiting the unsafe code scope and allowing custom unsafe code which can also be wrapped in safe interface.