Sujet : Re: Pre-main construction order in modules
De : Bonita.Montero (at) *nospam* gmail.com (Bonita Montero)
Groupes : comp.lang.c++Date : 30. Mar 2025, 21:15:03
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vsc8nl$2afmg$1@raubtier-asyl.eternal-september.org>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14
User-Agent : Mozilla Thunderbird
Am 30.03.2025 um 20:20 schrieb Mr Flibble:
But that is nevertheless what the Meyers Singleton involves. Static local
initialisation has been threadsafe since C++11 and if performance is a
concern then you can always cache the result in a reference downstream in
any hot path that needs it.
With current implemention all C++ runtimes govern all station initia-
lizations through a single mutex. That hurts if you have a constructor
that takes longer, maybe because of a socket-connection which the code
waits for.