<yu***@gmx.de> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com
Thank you John Carson,
very good link, it clears all, And one more question. If I will
somehow move the code outside of function scope to global scope, will
I resolve concurrency problem?
Thanks
If initialization takes place while your program still only has one thread,
then obviously you avoid the multi-threaded problem. A variable at global
scope will have this effect, provided you don't spawn any extra threads
until you enter main() (if, however, the constructor of a global variable
spawns a new thread, then you still have the problem).
Of course, global variables have their own problems if they appear in
multiple files.
http://www.parashift.com/c++-faq-lit...html#faq-10.12
--
John Carson