Subj : Re: posix and lock-free algorithms To : comp.programming.threads From : David Schwartz Date : Sun Jul 31 2005 02:50 pm "John Doug Reynolds" wrote in message news:1122829815.237744.74450@o13g2000cwo.googlegroups.com... > I get the idea that the issue is that Posix does not provide explicit > memory barriers. If so, then there must be some reason why this > construct does not do the trick: > > void memory_barrier() { mutex m; m.lock(); m.unlock(); } Mutexes only protect memory access that occur while the mutex is held. In principle, that could be optimized by a sufficiently smart implementation to nothing. DS .