Created on 2010-03-09.00:00:00 last changed 182 months ago
Proposed resolution:
Container data races [container.requirements.dataraces]
Paragraph 1 is unchanged as follows:
1 For purposes of avoiding data races (17.6.4.8), implementations shall consider the following functions to be
const:begin,end,rbegin,rend,front,back,data,find,lower_bound,upper_bound,equal_range, and, except in associative containers,operator[].
Edit paragraph 2 as follows:
2 Notwithstanding (17.6.4.8), implementations are required to avoid data races when the contents of the contained object in different elements in the same sequence, excepting
vector<bool>, are modified concurrently.
Edit paragraph 3 as follows:
3 [Note: For a
vector<int> xwith a size greater than one,x[1] = 5and*x.begin() = 10can be executed concurrently without a data race, butx[0] = 5and*x.begin() = 10executed concurrently may result in a data race. As an exception to the general rule, for avector<bool> y,y[i] = truemay race withy[j] = true. —end note]
Rationale:
Solved by N3069.
[
2010 Pittsburgh: Moved to NAD EditorialResolved. Rationale added below.
]
The common implementation of vector<bool> is as an unsynchronized bitfield. The addition of [container.requirements.dataraces]/2 would require either a change in representation or a change in access synchronization, both of which are undesireable with respect to compatibility and performance.
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2010-12-05 00:09:22 | admin | set | status: nad editorial -> resolved |
| 2010-10-21 18:28:33 | admin | set | messages: + msg1614 |
| 2010-10-21 18:28:33 | admin | set | messages: + msg1613 |
| 2010-10-21 18:28:33 | admin | set | messages: + msg1612 |
| 2010-03-09 00:00:00 | admin | create | |