This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: reference counting in string's allocator, where else?
- To: libstdc++ at gcc dot gnu dot org
- Subject: Re: reference counting in string's allocator, where else?
- From: Loren James Rittle <rittle at latour dot rsch dot comm dot mot dot com>
- Date: Tue, 28 Aug 2001 18:25:03 -0500 (CDT)
- Cc: Andrew dot Lundgren at Level3 dot com
- Organization: Networks and Infrastructure Lab (IL02/2240), Motorola Labs
In article <Pine.GSO.4.33.0108281044050.5805-100000@anaconda.vdev.level3.net>
you write:
> We have been running into problems (core dumps) with the allocators in
> string not being thread safe when using the 2.95.2 and 2.95.3 gcc
> builds.
Here is the best answer I can produce without looking very closely at
your problem:
If you configured 2.95.X with --enable-threads and your port is
configured to support threads when that switch is given (or you
explicitly configured with --enable-threads=X where X is supported by
your platform) AND you gave the correct compile and link time flags
for your platform, then container allocators should be thread-safe.
This may be true for string allocators, but I have no knowledge of
that code base.
If you didn't explicitly configure 2.95.X with --enable-threads, then
it is doubtful that your port's libstdc++ will support threads
properly no matter what run-time switches you provide.
If you upgrade to 3.X, the situation is somewhat better. First of
all, many ports will now enable thread support by default. We can now
ensure that the compiler was built properly with the `gcc -v' report.
Second of all, you should not need to define non-standard macros to
obtain correct threaded operation (as was the case with many ports
before the 3.0 release). If on a platform that supports weak symbols,
ELF and POSIX threads (such as your linux platform), most/all
configuration issues should be gone. I believe that ports that
support other models will still work better than 2.95.X, but it gets
less testing. Finally (echoing Benjamin's point), you will get some
support if you use 3.X. I don't know anyone willing to fix threading
issues in 2.95.X...
Regards,
Loren
--
Loren J. Rittle
Senior Staff Software Engineer, Distributed Object Technology Lab
Networks and Infrastructure Research Lab (IL02/2240), Motorola Labs
rittle@rsch.comm.mot.com, KeyID: 2048/ADCE34A5, FDC0292446937F2A240BC07D42763672