[Bug libstdc++/40297] [C++0x] debug mode vs atomics

jwakely dot gcc at gmail dot com gcc-bugzilla@gcc.gnu.org
Thu Jun 18 12:43:00 GMT 2009



------- Comment #4 from jwakely dot gcc at gmail dot com  2009-06-18 12:43 -------
(In reply to comment #2)
> It seems strange to me that clear() allows memory_order_consume but not
> acquire. I'll ask on the lib reflector if that's an oversight,

I asked and everyone agreed it should disallow consume so Lawrence Crowl will
address it in a forthcoming paper.

(In reply to comment #3)
> me, so yes proceed please. I'm still not sure that this kind of debug mode only
> error handling is correct but it seems like an approach that is vaguely
> familiar from other parts of the library. So at least usage is consistent, even
> if the original implementation was plain wrong....

The approach seems fine to me, but then I'm a frequent user of _GLIBCXX_DEBUG
anyway.

> There are many problems with memory ordering in the atomics2 implementation. It
> is known to be incorrect and incomplete, as the saying goes. The goal was to
> start experimenting with compliler builtins assuming x86_64 hardware and see
> how far we got, what kind of compiler intrinsics we needed first, how we test
> this stuff, etc etc.

The current code is more than good enough to let me start experimenting and
feeling my way around so please take my comments as feedback not complaints :-)

I'll prepare a patch to reverse the sense of the debug assertions, but won't
change anything else.


-- 


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



More information about the Gcc-bugs mailing list