4 ms·
>impossible to write code containing a data race https://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=Rust+data+race https://cve.mitre.org/cgi-bin/cvekey.cgi?keywo
by sk1459 5y ago
>impossible to write code containing a data race
https://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=Rust+data+race https://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=Rust+data+r...
- andrewaylett 5y agoOK, I'll grant I should have added scare quotes to "impossible". A quick check suggests that (as would be expected) they're caused by `unsafe` blocks. Specifically, by the developer claiming that a value was safe to send to a different thread while it actually wasn't. One thing to note is that these bugs neutralised the compiler's validation is these specific cases -- allowing, rather than causing, races. Using unsafe means the developer needs to ensure they maintain the invariants themselves within the unsafe block, while in C++ one has to maintain these invariants in _all_ code.