This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/20099] -pthreads should imply -fno-threadsafe-statics
- From: "gniccolai at yahoo dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 22 Feb 2005 10:27:34 -0000
- Subject: [Bug c++/20099] -pthreads should imply -fno-threadsafe-statics
- References: <20050220004607.20099.davids@webmaster.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From gniccolai at yahoo dot com 2005-02-22 10:27 -------
>
> You say a hypothetical multithreaded C++ should state this as the semantics for
> static locals, and I don't disagree with you, provided we are not talking about
> one based on POSIX threads. POSIX specifically made the design decision to
> always require explicit locks and to always require the programmer to find,
> document, and lock cases where concurrent accesses might occur.
I think I wrote a rationale that explains and justifies this choice at
http://www.niccolai.ws/works/articoli/art-multithreading-en-1a.html
I had not been able to find an official rationale from open group; the nearest
thing seems to be:
http://www.unix.org/whitepapers/reentrant.html
If more precise and authoritative ones are available, please point them out.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20099