This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/13684] local static object variable constructed once but ctors and dtors called multiple times on same memory when called in multiple threads
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 15 Jul 2004 02:42:54 -0000
- Subject: [Bug c++/13684] local static object variable constructed once but ctors and dtors called multiple times on same memory when called in multiple threads
- References: <20040114172507.13684.evijaykumar@yahoo.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From bangerth at dealii dot org 2004-07-15 02:42 -------
It's not quite a one-time thing, of course: every time you run over
a static variable, you have to check whether it has already been
initialized. If this check has to be guarded by a lock, it gets vastly
more expensive than just checking for zero-or-one.
Nevertheless, I believe that this should eventually be implemented.
W.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13684