This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/51798] [4.7 regression] libstdc++ atomicity performance regression due to __sync_fetch_and_add


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

--- Comment #5 from David Edelsohn <dje at gcc dot gnu.org> 2012-01-24 15:29:44 UTC ---
Are you suggesting that the existing atomicity support in libstdc++ should be
changed to use ACQ_REL semantics?

libstdc++ uses one function to both acquire and release a lock.  It adds a
positive value (increment) to acquire a lock and a negative value (decrement)
to release a lock.

POWER appears to be the most flexible and delicate platform with respect to
atomic operations and we have been building and testing with my patch for weeks
without problem.  ACQUIRE, RELEASE, ACQ_REL and SEQ_CST does not make a
practical difference in the emitted code on other platforms, so relaxing the
semantics would not cause a problem.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]