This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/33892] [libstdc++ v3 parallel mode] Parallel mode algorithms use critical sections with global scope
- From: "singler at ira dot uka dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 2 Nov 2007 15:50:47 -0000
- Subject: [Bug libstdc++/33892] [libstdc++ v3 parallel mode] Parallel mode algorithms use critical sections with global scope
- References: <bug-33892-15121@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #5 from singler at ira dot uka dot de 2007-11-02 15:50 -------
(In reply to comment #4)
> (In reply to comment #2)
> > BTW, compatibility.h is horribly i?86/x86_64 centric, there are many other
> > arches
> > which support 64-bit __sync_fetch_and_add and __sync_bool_compare_and_swap
> > (e.g. ia64, ppc64, sparc64, sparcv9, s390x, I believe also s390, etc.).
Well, there is a lot of obsolete code for compatibility to other compilers.
Most of that could probably be kicked out, when we rely on the GCC
infrastructure.
> About that, wanted to remind Johannes that we also have the various
> __GCC_HAVE_SYNC_COMPARE_AND_SWAP_* which may be useful in such cases...
Okay. Then, there should only two cases be necessary:
*natively supported by the GCC infrastructure, use __sync_fetch_and_add and
__sync_bool_compare_and_swap
*not supported by the GCC infrastructure, use OpenMP locks
For the latter case, this means bad performance, but the usefulness of the
parallel mode is questionable anyway on platforms that do not support these
atomic operations.
What about that?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33892