tmp/tmpeolwsur7/{from.md → to.md}
RENAMED
|
@@ -4,16 +4,17 @@ For purposes of avoiding data races ([[res.on.data.races]]),
|
|
| 4 |
implementations shall consider the following functions to be `const`:
|
| 5 |
`begin`, `end`, `rbegin`, `rend`, `front`, `back`, `data`, `find`,
|
| 6 |
`lower_bound`, `upper_bound`, `equal_range`, `at` and, except in
|
| 7 |
associative or unordered associative containers, `operator[]`.
|
| 8 |
|
| 9 |
-
Notwithstanding
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
|
| 14 |
-
For a `vector<int> x` with a size greater than one,
|
| 15 |
-
`*x.begin() = 10` can be executed concurrently without a
|
| 16 |
-
`x[0] = 5` and `*x.begin() = 10` executed concurrently
|
| 17 |
-
data race. As an exception to the general rule, for a
|
| 18 |
-
`y[0] = true` may race with
|
|
|
|
| 19 |
|
|
|
|
| 4 |
implementations shall consider the following functions to be `const`:
|
| 5 |
`begin`, `end`, `rbegin`, `rend`, `front`, `back`, `data`, `find`,
|
| 6 |
`lower_bound`, `upper_bound`, `equal_range`, `at` and, except in
|
| 7 |
associative or unordered associative containers, `operator[]`.
|
| 8 |
|
| 9 |
+
Notwithstanding [[res.on.data.races]], implementations are required to
|
| 10 |
+
avoid data races when the contents of the contained object in different
|
| 11 |
+
elements in the same container, excepting `vector<bool>`, are modified
|
| 12 |
+
concurrently.
|
| 13 |
|
| 14 |
+
[*Note 1*: For a `vector<int> x` with a size greater than one,
|
| 15 |
+
`x[1] = 5` and `*x.begin() = 10` can be executed concurrently without a
|
| 16 |
+
data race, but `x[0] = 5` and `*x.begin() = 10` executed concurrently
|
| 17 |
+
may result in a data race. As an exception to the general rule, for a
|
| 18 |
+
`vector<bool> y`, `y[0] = true` may race with
|
| 19 |
+
`y[1] = true`. — *end note*]
|
| 20 |
|