Subject: |
c++ 0x initialization of local (block scoped) static variables |
From: |
"Jeff Hill" <[email protected]> |
To: |
"'EPICS Core Talk'" <[email protected]> |
Date: |
Thu, 11 Aug 2011 18:01:02 -0600 |
Interesting reading about concurrent initialization of local (block scoped)
static variables in the latest working draft of the c++ standard.
See section 6.7.
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3242.pdf
"If control enters the declaration concurrently while the variable is being
initialized, the concurrent execution shall wait for completion of the
initialization. If control re-enters the declaration recursively while the
variable is being initialized, the behavior is undefined"
Note however that, after a quick read, I think I understand that no such
guarantees exist for dynamic initialization of file scoped static variables.
Jeff
______________________________________________________
Jeffrey O. Hill Email [email protected]
LANL MS H820 Voice 505 665 1831
Los Alamos NM 87545 USA FAX 505 665 5107
Message content: TSPA
With sufficient thrust, pigs fly just fine. However, this is
not necessarily a good idea. It is hard to be sure where they
are going to land, and it could be dangerous sitting under them
as they fly overhead. -- RFC 1925
- Navigate by Date:
- Prev:
Re: c++ static initialization Benjamin Franksen
- Next:
Re: [Merge] lp:~epics-core/epics-base/epicsR3.15-atomics into lp:epics-base Janet B. Anderson
- Index:
2002
2003
2004
2005
2006
2007
2008
2009
2010
<2011>
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
Re: c++ static initialization Hill, Bruce
- Next:
[Merge] lp:~epics-core/epics-base/3.15-buildCompilerSpecific into lp:epics-base Jeff Hill
- Index:
2002
2003
2004
2005
2006
2007
2008
2009
2010
<2011>
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
|