This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/24704] __gnu_cxx::__exchange_and_add is called even for single threaded applications
- From: "pcarlini at suse dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 22 May 2006 08:54:39 -0000
- Subject: [Bug libstdc++/24704] __gnu_cxx::__exchange_and_add is called even for single threaded applications
- References: <bug-24704-7094@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #23 from pcarlini at suse dot de 2006-05-22 08:54 -------
(In reply to comment #22)
> This would mean a non-enable-threads compiled libstdc++ would skip the calls
> to __exchange_and_add?
Of course the idea would not be that of "skipping", instead providing a version
of __exchange_and_add not using slow atomics and inlined.
> And to clarify, there would be no other way to skip these calls except
> making a separate non-threaded libstdc++?
Yes. At least for this PR. If you can provide compelling experimental evidence
that normal users can pay the overhead of checking each __gthread_active_p()
each time, then we could reconsider that, in a *separate* PR. Also, since we
are moving anyway to not-reference-counted strings (already provided in ext/),
there is not much point for more invasive and complex changes.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24704