2 ms·
Nice article, but I wanted to point out that you seem to imply that Rust "mitigate(s) or completely eliminate(s)" deadlocks and race conditions. Neither of thes
by thisisrandy 5y ago
Nice article, but I wanted to point out that you seem to imply that Rust "mitigate(s) or completely eliminate(s)" deadlocks and race conditions. Neither of these is true:
0. Deadlock: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=0a03355bbdc9edfa3eaa219992f4b7a5 https://play.rust-lang.org/?version=stable&mode=debug&editio...
1. Race condition: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=4ce2768d4c57dfd1469e3127d29e1c16 https://play.rust-lang.org/?version=stable&mode=debug&editio...
Perhaps you were thinking about data races, which are unsafe and therefore not allowed by Safe Rust? The Rustonomicon (https://doc.rust-lang.org/nomicon/races.html https://doc.rust-lang.org/nomicon/races.html) defines data races as:
- two or more threads concurrently accessing a location of memory
- one or more of them is a write
- one or more of them is unsynchronized
Possibly you knew all of this and just got carried away in your enthusiasm for Rust (very much shared!), but lest your readers think Rust is actual magic instead of merely amazing, it might be nice to clarify the article.