This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
Re: libstdc++/5464: STL problem using multithreading
- From: ljrittle at gcc dot gnu dot org
- To: gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, jjessel at amadeus dot net, nobody at gcc dot gnu dot org
- Date: 23 Jan 2002 16:51:26 -0000
- Subject: Re: libstdc++/5464: STL problem using multithreading
- Reply-to: ljrittle at gcc dot gnu dot org, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, jjessel at amadeus dot net, nobody at gcc dot gnu dot org, gcc-gnats at gcc dot gnu dot org
Synopsis: STL problem using multithreading
State-Changed-From-To: open->closed
State-Changed-By: ljrittle
State-Changed-When: Wed Jan 23 08:51:24 2002
State-Changed-Why:
Your program works fine with gcc 3.0.X on a system that
both has C++ thread support and has it enabled properly.
Some platforms are supported better than others.
I can confirm that your example code works fine
on Solaris 2.6 with gcc 3.0.3 and FreeBSD with gcc mainline.
I can confirm that it crashed with gcc 2.95.X on FreeBSD
in a manner you found. FYI, no one to my knowledge is
fixing libstdc++-v2 bugs in 2.95.X.
FYI, I only reviewed the code quickly before testing it:
your use of the global varibale "contention" is not
threadsafe but mostly harmless. Also, you should be
aware that cout, etc are all shared global variables
and thus it may not be safe to use them as you do.
(offhand, I don't know the worst problem you might
see.)
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=5464