libstdc++/5464: STL problem using multithreading
ljrittle@gcc.gnu.org
ljrittle@gcc.gnu.org
Wed Jan 23 08:55:00 GMT 2002
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
More information about the Gcc-bugs
mailing list