In C++, are static initializations of primitive types to constant values thread-safe? -


That is, will any of the expected environment be expected to be executed properly?

  int dostaf (zero) {static int somevalue = 12345; Return some value; }  

Is it possible to call many threads, and to return whatever was wasted on and somevalue before the execution begins To call?

from C ++ standard, volume 6.7:

A local object of type POD (

3. 9) With static blocking period, starting with the initial stability, before the block is first entered.

This means that the function-level static object has entered the function for the first time, not necessarily when the process is fully initiated. At this point, many threads can run well.


Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -