3 ms·
This is not a "data race" in a formal sense. A data race involves multiple threads accessing a non-atomic data object in ways that might result in an unintended
by zozbot234 7y ago
This is not a "data race" in a formal sense. A data race involves multiple threads accessing a non-atomic data object in ways that might result in an unintended and inconsistent state if the accesses overlap. That's always a bug.
- jfkebwjsbx 7y agoA data race does not necessarily imply a bug, even within your definition (which is only relevant for classical multithreaded applications).
- steerablesafe 7y agoIn C++ a data race is UB, so it is most definitely always a bug there.
- CodesInChaos 7y agoThe C++ standard's definition of a datarace only applies to ordinary memory access and rules those cases UB. But if you port such code to use relaxed load/store operations it's just as racey, but no longer UB. I'd consider still consider those cases data races, even though they don't meet the C++ standard's definition of them.
- steerablesafe 7y agoThen you probably don't consider Rust datarace free as well.