This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
HELP: GCC 2.95.3 Thread Safe IO
- To: gcc-help at gcc dot gnu dot org, libstdc++ at gcc dot gnu dot org
- Subject: HELP: GCC 2.95.3 Thread Safe IO
- From: Paul Dubuc <pdubuc at cas dot org>
- Date: Tue, 06 Nov 2001 11:03:34 -0500
- Newsgroups: gnu.g++.help,gnu.g++.lib,gnu.gcc.help
- Organization: Chemical Abstracts Service (CAS)
Problem: We have converted a large multi-threaded software project from
using Sun's C++ compiler on Solaris to g++ 2.95.3 (built from source,
contains V2.10.0 of libstdc++). Now we are having runtime problems that
suggest that the IO library is not thread safe. Evidence of data
corruption shows up when a process terminates and IO cleanup routines in
libio/genops.c are called. When I look through the source I see some
#ifdef _IO_MTSAFE_IO code, but this option doesn't seem to have been
defined even though we configure our build with the --enable_threads
option. Also, it doesn't seem to be fully implemented. For example,
modification of the _IO_list_all linked list is not protected in
routines like _IO_un_link() and _IO_link_in().
At this point the best option I can think of is to upgrade the libstdc++
to V3. I have downoaded that source and libio/genops.c does have more
_IO_MTSAFE_IO locks in place. Is thread safe IO fully implemented in
this library? What confguration or make option is needed to define
_IO_MTSAFE_IO?
Can I use libstdc++-v3 with GCC 2.95.3 (without upgrading the compiler
to 3.0.2)? If I can, are there special build instructions. The FAQ
says that GCC 3 should be used, but also seems to imply that 2.95 can
also be used
(http://gcc.gnu.org/onlinedocs/libstdc++/faq/index.html#2_1). It says
that there are instructions for building GCC 2.95 with libstdc++-v3 at
http://gcc.gnu.org/onlinedocs/libstdc++/install.html but I can't find
them.
Any help or ideas of other options will be very much appreciated.
Thanks,
Paul Dubuc
--
Paul M. Dubuc pdubuc@cas.org