public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/51798] New: [4.7 regression] libstdc++ atomicity performance regression due to __sync_fetch_and_add
@ 2012-01-09 14:31 dje at gcc dot gnu.org
  2012-01-09 14:36 ` [Bug libstdc++/51798] " dje at gcc dot gnu.org
                   ` (32 more replies)
  0 siblings, 33 replies; 34+ messages in thread
From: dje at gcc dot gnu.org @ 2012-01-09 14:31 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51798

             Bug #: 51798
           Summary: [4.7 regression] libstdc++ atomicity performance
                    regression due to __sync_fetch_and_add
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: dje@gcc.gnu.org


libstdc++ uses __sync_fetch_and_add() to provide atomicity for reference
counting.  The semantics of __sync_fetch_and_add() were not explicitly stated. 
libstdc++ apparently requires ACQUIRE semantics for incrementing the reference
count and RELEASE semantics for decrementing the reference and possibly
destroying the object.  The libstdc++ code did not make this distinction, but
__sync_fetch_and_add() generally was implemented as RELEASE semantics, which
was overkill for increment and appropriate for decrement/destroy.

As part of the C++11 memory model changes, __sync_fetch_and_add() atomicity was
changed to use the new, more general atomicity infrastructure with SEQUENTIAL
CONSISTENCY.  This imposes the most strict and heavy-weight barrier.

On architectures with granularity and gradations in the implementation of
atomic instructions, this introduces a severe performance regression.


^ permalink raw reply	[flat|nested] 34+ messages in thread

end of thread, other threads:[~2012-02-17 20:52 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-09 14:31 [Bug libstdc++/51798] New: [4.7 regression] libstdc++ atomicity performance regression due to __sync_fetch_and_add dje at gcc dot gnu.org
2012-01-09 14:36 ` [Bug libstdc++/51798] " dje at gcc dot gnu.org
2012-01-09 14:38 ` dje at gcc dot gnu.org
2012-01-09 15:43 ` rguenth at gcc dot gnu.org
2012-01-09 17:12 ` dje at gcc dot gnu.org
2012-01-24  7:45 ` amacleod at redhat dot com
2012-01-24 16:46 ` dje at gcc dot gnu.org
2012-01-24 16:51 ` amacleod at redhat dot com
2012-01-25 14:27 ` jakub at gcc dot gnu.org
2012-01-25 15:39 ` dje at gcc dot gnu.org
2012-01-25 16:09 ` amacleod at redhat dot com
2012-01-25 16:17 ` dje at gcc dot gnu.org
2012-01-26 13:52 ` jakub at gcc dot gnu.org
2012-01-26 14:38 ` amacleod at redhat dot com
2012-01-26 15:50 ` dje at gcc dot gnu.org
2012-01-26 15:53 ` redi at gcc dot gnu.org
2012-01-26 21:50 ` dje at gcc dot gnu.org
2012-01-26 22:08 ` redi at gcc dot gnu.org
2012-01-27 10:09 ` jakub at gcc dot gnu.org
2012-01-27 11:37 ` jakub at gcc dot gnu.org
2012-01-27 13:03 ` amacleod at redhat dot com
2012-01-27 14:55 ` dje at gcc dot gnu.org
2012-01-27 15:01 ` jakub at gcc dot gnu.org
2012-01-27 15:26 ` dje at gcc dot gnu.org
2012-01-27 20:15 ` bkoz at gcc dot gnu.org
2012-01-27 21:05 ` jakub at gcc dot gnu.org
2012-01-27 21:08 ` jakub at gcc dot gnu.org
2012-02-09  8:46 ` bkoz at gcc dot gnu.org
2012-02-09  9:16 ` redi at gcc dot gnu.org
2012-02-09 20:08 ` bkoz at gcc dot gnu.org
2012-02-09 23:22 ` bkoz at gcc dot gnu.org
2012-02-10 18:21 ` bkoz at gcc dot gnu.org
2012-02-13 21:31 ` rth at gcc dot gnu.org
2012-02-17 21:03 ` bkoz at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).