Subj : Re: posix and lock-free algorithms To : comp.programming.threads From : David Schwartz Date : Thu Aug 04 2005 11:23 am "David Hopwood" wrote in message news:OLqIe.861$ia4.479@fe1.news.blueyonder.co.uk... > John Doug Reynolds wrote: >> They do not discuss constructing a memory barrier from the available >> Posix synchronization primitives, or explain why >> >> void memory_barrier() { mutex m; m.lock(); m.unlock(); } >> >> does not work for that purpose. It does work for that purpose. However: > "Applications shall ensure that access to any memory location by more > than one thread of control (threads or processes) is restricted such > that no thread of control can read or modify a memory location while > another thread of control may be modifying it." That still bites you. DS .