3 ms·
Yeah it would be a grave misinterpretation of "fearless concurrency" to think Rust somehow validates that access to some shared resource with it's own semantics
by hderms 6y ago
Yeah it would be a grave misinterpretation of "fearless concurrency" to think Rust somehow validates that access to some shared resource with it's own semantics is also safe. I'm not educated on the subject but that problem seems pretty intractable for a language to solve in a general sense.
- pjmlp 6y agoIndeed, yet that is not how many Rust advocacy blog posts sell it.
- shakow 6y agoSuch as?
- pjmlp 6y agoAny blog post that gives examples accessing shared variables and never goes beyond anything else, leaving to the reader that it works the same way regardless of what resources are being accessed. https://blog.knoldus.com/how-we-can-do-fearless-concurrency-in-rust/ https://blog.knoldus.com/how-we-can-do-fearless-concurrency-... Now rewrite the same blog post using SQL queries to update the same counter variable on a table row. The Rustonomicon is quite clear that it wouldn't work, > However Rust does not prevent general race conditions. https://doc.rust-lang.org/nomicon/races.html https://doc.rust-lang.org/nomicon/races.html
- shakow 6y agoYou really had to dig a post that has less text than code? > leaving to the reader that it works the same way regardless of what resources are being accessed. If that's how readers envision that non-language-managed resources work, they should go back to CS102 right now. And concerning the nomicon, it explicitly states that Rust can't handle all races condition, I don't get your point.