4 ms·
Not really, in Rust's case. It's the general borrow checker which handles this. Since in Rust it is illegal for a value to be referenced for writing in one pla
by tsimionescu 7y ago
Not really, in Rust's case. It's the general borrow checker which handles this.
Since in Rust it is illegal for a value to be referenced for writing in one place and referenced for anything else in any other place, regardless of concurrency/parallelism, Rust code is data-race free by design.
I still think that GP's comment was a non-sequitur.
- zozbot234 7y agoRust has "interior" mutability, meaning that shared references are not true 'read only' references; they can be used for writing if the type supports such an operation. What makes Rust data-race free is the combination of 'interior' mutability and the Send and Sync traits, which control moving or referencing objects across threads.