Skip to content

Commit 45a997a

Browse files
authored
Data Race definition should be more precise
"one of them is a write" did not seem right to me. Doesn't generalise to the case with two concurrent threads writing to shared memory. [Related Wikipedia article](https://en.wikipedia.org/wiki/Race_condition#Example_definitions_of_data_races_in_particular_concurrency_models)
1 parent c941723 commit 45a997a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/races.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
Safe Rust guarantees an absence of data races, which are defined as:
44

55
* two or more threads concurrently accessing a location of memory
6-
* one of them is a write
7-
* one of them is unsynchronized
6+
* one or more of them is a write
7+
* one or more of them is unsynchronized
88

99
A data race has Undefined Behavior, and is therefore impossible to perform
1010
in Safe Rust. Data races are *mostly* prevented through Rust's ownership system:

0 commit comments

Comments
 (0)