Subj : Re: posix and lock-free algorithms To : comp.programming.threads From : Alexander Terekhov Date : Thu Aug 11 2005 02:38 pm John Doug Reynolds wrote: [...] > But the "reader" thread does place a memory barrier between its read > of pInstance and any attempt to access *pInstance. Not really. Because apart from the fact that your code is data-race UNfree, lock-unlock under POSIX-compatible release consistency models doesn't really substitute a bidirectional fence. It would sorta work in your case (violation of POSIX data-race free requirement aside for a moment), but only if you lock-unlock the *same* mutex on both slow and "fast" paths, not different mutexes on the stacks of participating threads. regards, alexander. .