4 ms·
A race condition is not the same as a data race, and nondeterminism is not the same as undefined behavior.
by kam 3y ago
A race condition is not the same as a data race, and nondeterminism is not the same as undefined behavior.
- bjourne 3y agoFine, but in practice a data race is just a special case of a race condition so my point still stands. Most multi-threaded code with races is more like my example than the author's and Rust will not magically prevent such race conditions.
- pjmlp 3y agoIndeed, I like your example, usually I go after external resources being accessed from same threads, database accesses without proper transaction management, or OS IPC, where the Rust threads don't have any visibility about what the other processes are doing.