News for hackers. Stuff that matters.
Re:Java is not a safe language by DougBTX on Monday June 13, 2022 @07:09AM (#31723755)
> Data races are mostly prevented through Rust's ownership system: it's impossible to alias a mutable reference, so it's impossible to perform a data race.

https://doc.rust-lang.org/nomicon/races.html

Re:Java is not a safe language by Sankozi on Monday June 13, 2022 @09:18AM (#31725126)
Definition of data race on that page is very limited.

Also on the same page "Data races are mostly prevented through Rust's ownership system".

Re:Java is not a safe language by kaba0 on Monday June 13, 2022 @05:32PM (#31732051)
Rust does prevent data races (as in multiple threads writing to the same memory location is explicitly forbidden by the borrow checker), but it doesn’t prevent race conditions, which is a more general family of concurrency bugs.

In short, the borrow checker allows a single owner at all times, or it allows references to the object, abiding these rules: it may have any number of read-only references (they are safe to share), OR a single read-write reference.