Subj : Re: What does Memory Barriers mean ?? To : comp.programming.threads From : David Hopwood Date : Tue Jan 11 2005 10:54 pm David Schwartz wrote: > "SenderX" wrote: > >>>No. Calling an assembly routine, unless it is a standard library >>>function, already causes undefined behaviour according to the standards. > >>Yes. The calling convention is an issue. > > 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 > every level of optimization without you having to do anything other than > correctly follow the documentation. Black magic is not needed. If you mean that, in principle, implementations *should* provide sufficient and accurate documentation of all their calling conventions and how optimizations interact with them in the case of multithreaded code, then who could disagree? If you mean that they are in fact so documented (for example in the case of VC++ and gcc), then I definitely disagree. -- David Hopwood .