"is static init thread-safe with vc2010?" Code Answer


from visual studio 2010's documentation on static:

assigning a value to a static local variable in a multithreaded application is not thread safe and we do not recommend it as a programming practice.

the second part of your question has some good existing answers.

updated nov 22, 2015:

others have verified, specifically, that static initialization is not thread safe either (see comment and other answer).

user squelart on vs2015:

you may want to add that vs2015 finally gets it right: https://msdn.microsoft.com/en-au/library/hh567368.aspx#concurrencytable ("magic statics")

By LeBodro on January 30 2022

Answers related to “is static init thread-safe with vc2010?”

Only authorized users can answer the Search term. Please sign in first, or register a free account.