Subj : posix and lock-free algorithms To : comp.programming.threads From : John Doug Reynolds Date : Sun Jul 31 2005 11:10 am [from the 19 May 2005 posting by Joe Seigh] > The only thing we can say about Posix is there are a few well known > thread design patterns that are widely considered as being supposed > to work in Posix. DCL (DCSI) as being an example of a pattern that > does not work in Posix. I'd name some patters that do work in Posix > but I don't think we have names for those patterns. Joe, I have been following c.p.t archives on DCL/DCSI going back seven years, starting with Dave Butenhof's FAQ (wonderful resource, thanks Dave!), but somehow I've missed the conclusion you stated here, and I'm hoping you can point me to where the explanation is given. Most postings I've read so far seem to conclude that DCSI is possible, the only problem being how to implement it under Posix. That's where the statements usually get pretty vague, and I'd like to understand this point. If it's just a problem of implementation, can we expect that some future version of Posix will support this pattern? 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(); } Is this explained somewhere? Or is it that--as I believe David Holmes has stated--even memory barriers do not fix this pattern? If so, why is it only a problem of implementation under Posix, and not a fundamental flaw in the pattern itself? Also, you mention the existence of some lock-free patterns that can be implemented under Posix but don't have well known names. Can you offer some keywords that I might search on? Finally, being new to MT/MP programming, I would like to express my appreciation to the sages of c.p.t for all that I've learned here, and in particular for saving me from my naivety about the importance of always using mutexes! Doug .