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: 8 Nov 2005 14:54:26 -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 #19 from pcarlini at suse dot de 2005-11-08 14:54 -------
(In reply to comment #18)
> Sure, this is the general idea. I'm a little bit concerned that for something
> apparently so elemental as an addiction (atomic, yes...) we are going to add
> a conditional, but probably, given the many cycles of atomics, it's ok. Any
> chance you can benchmark a bit that? I gather you already played with adding
> those checks, can you measure the overhead of the conditional alone compared
> to not doing nothing (i.e., non-atomic inline addition/subtraction).
Actually, this kind of benchmarking is not necessary, because currently we
are always using the normal atomics. We have only to check that the additional
__gthread_active_p() conditional is not measurable wrt the atomics itself.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24704