On 31 Jul, 19:44, [EMAIL PROTECTED] wrote: > I've got a bit of code in a multithreaded program that implements a > non-blocking concurrent queue. I want to optimize my code as much as > possible because it must work in a high-performance environment, but > I'm afraid of the optimization routines messing up the ordering of my > queue code. > > Is there some kind of preprocessor line or something to instruct the > optimizer to not optimize a certain section of code, but still be able > to optimize the rest?
Sounds like you need memory barriers. http://en.wikipedia.org/wiki/Memory_barrier http://gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc/Atomic-Builtins.html _______________________________________________ help-gplusplus mailing list help-gplusplus@gnu.org http://lists.gnu.org/mailman/listinfo/help-gplusplus