mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2026-07-11 17:51:37 +00:00
test: pre-fill libstdc++ ctype caches before threads exist
- std::ctype<char> caches narrow()/widen() results per character in plain char arrays of the global classic-locale facet, written without synchronization from header-inlined code (locale_facets.h); two threads exercising an uncached character concurrently (e.g. compiling a std::regex in Channel::Validate) constitute a true data race that ThreadSanitizer rightfully reports - the stores are real and unsynchronized, so a tsan-instrumented libstdc++ cannot help here; instead fill the caches before any thread is spawned, which turns every later access into a pure read - warm the lazily-installed num_put/num_get caches used by stream insertion/extraction as well, via a small format/parse round-trip - wire the warm-up into the gtest runner main() and, via a static initializer, into the test device runner
This commit is contained in:
committed by
Dennis Klein
parent
fc69b5e7ae
commit
2bd9a072a9
@@ -32,6 +32,7 @@ endif()
|
||||
add_testhelper(runTestDevice
|
||||
SOURCES
|
||||
helper/runTestDevice.cxx
|
||||
helper/LocaleWarmup.h
|
||||
helper/devices/TestPairLeft.h
|
||||
helper/devices/TestPairRight.h
|
||||
helper/devices/TestPollIn.h
|
||||
|
||||
Reference in New Issue
Block a user