static initialization

2 moment(s) that assert this concept — showing 1–2 of 2

single sourceRests on a single channel — treat as a lead, verify independently
↣ how this spread over time →
provenance — click a node to open its encoding unit
[1] CppCon[2] CppCon
showing 2 of 2 moments
CppCon · youtube · en
1Prior to C++11, the thread safety of static initialization was undefined due to lack of atomic guarantees in the language standard.
“C++ uh before C++ 11 C++ standard had exactly this to say on the subject”
spoken · 598s · 2015-10-09
CppCon · youtube · en
2Static initialization with a null check can lead to a data race when multiple threads simultaneously detect a null pointer and attempt to create a new object.
“two threads come in both start executing this code they both see null they both go in construct a copy of an object now one of them leaks because you you only have one pointer the other assignment got stomped”
spoken · 680s · 2015-10-09