mirror of
https://github.com/isocpp/CppCoreGuidelines.git
synced 2024-03-22 13:30:58 +08:00
Merge branch 'tituswinters-thread-tooling'
This commit is contained in:
commit
b7a3c641c6
|
@ -11697,16 +11697,16 @@ this can be a security risk.
|
||||||
|
|
||||||
##### Enforcement
|
##### Enforcement
|
||||||
|
|
||||||
Some is possible, do at least something.
|
When possible, rely on tooling enforcement, but be aware that any tooling
|
||||||
There are commercial and open-source tools that try to address this problem, but static tools often have many false positives and run-time tools often have a significant cost.
|
solution has costs and blind spots. Defense in depth (multiple tools, multiple
|
||||||
We hope for better tools.
|
approaches) is particularly valuable here.
|
||||||
|
|
||||||
Help the tools:
|
There are other ways you can mitigate the chance of data races:
|
||||||
|
|
||||||
* less global data
|
* Avoid global data
|
||||||
* fewer `static` variables
|
* Avoid `static` variables
|
||||||
* more use of stack memory (and don't pass pointers around too much)
|
* More use of value types on the stack (and don't pass pointers around too much)
|
||||||
* more immutable data (literals, `constexpr`, and `const`)
|
* More use of immutable data (literals, `constexpr`, and `const`)
|
||||||
|
|
||||||
### <a name="Rconc-data"></a>CP.3: Minimize explicit sharing of writable data
|
### <a name="Rconc-data"></a>CP.3: Minimize explicit sharing of writable data
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
'
|
'
|
||||||
0xFF0000
|
0xFF0000
|
||||||
0b0101'0101
|
0b0101'0101
|
||||||
|
10x
|
||||||
'14
|
'14
|
||||||
|
20x
|
||||||
2D
|
2D
|
||||||
2K
|
2K
|
||||||
2ndEdition
|
2ndEdition
|
||||||
|
@ -69,6 +71,7 @@ CComPtr
|
||||||
cerr
|
cerr
|
||||||
chrono
|
chrono
|
||||||
cin
|
cin
|
||||||
|
Clang's
|
||||||
class'
|
class'
|
||||||
clib
|
clib
|
||||||
Cline99
|
Cline99
|
||||||
|
@ -492,6 +495,7 @@ toolchains
|
||||||
TotallyOrdered
|
TotallyOrdered
|
||||||
TP
|
TP
|
||||||
tradeoff
|
tradeoff
|
||||||
|
TSAN
|
||||||
TSs
|
TSs
|
||||||
tt
|
tt
|
||||||
typeid
|
typeid
|
||||||
|
|
Loading…
Reference in New Issue
Block a user