Subj : Re: What does Memory Barriers mean ?? To : comp.programming.threads From : Alexander Terekhov Date : Tue Jan 11 2005 12:28 pm David Schwartz wrote: [...] > You guys are construing "standards" very narrowly. When I say > "standards", I mean all the relevant documentation that accompanies all the > interfaces and extensions you are using. If you use GCC's inline assembly > correctly, according to the documentation, your code will work perfectly at According to the GCC's documentation, "Even a volatile asm instruction can be moved in ways that appear insignificant to the compiler". GCC's notion of full-stop barrier via memory clobbers and "asm volatile" sucks miserably... even if we assume that it works "as expected" (i.e. as a real bidirectional compiler fence). > every level of optimization without you having to do anything other than > correctly follow the documentation. Black magic is not needed. Yeah, just a bit of luck. regards, alexander. .