Subj : Re: double-checked locking in C To : comp.programming.threads From : David Schwartz Date : Fri Jul 08 2005 06:13 am "Joe Seigh" wrote in message news:I5OdnbMTivIl9lPfRVn-1g@comcast.com... > So given that both can break and > somebody has to do the porting, I'd say both DCL and Posix are equally > portable except there's probably more headcount available to do the > porting > for Posix pthreads. > AKA future proofing and no, you can't future proof anything. That's why > C doesn't work for things it never anticipated and Posix pthreads won't > work for things it never anticipated. C code I wrote in the 1980s for Apple ]['s compiles and runs on my dual P3 Linux box with no problem. I'll bet computers in 20 years (with hardware capabilities I can't even imagine now) will provide the ability to compile POSIX-compliant code with no changes. It is possible that, for example, supporting POSIX-style mutexes may reduce performance some horrible amount compared to some new style of synchronization that works better on the hardware in 20 years. But it will still be possible to implement mutexes and people will do it. (The machine will have no problem emulating one of today's CPUs if it has to.) As far as DCL versus pthreads and future proofing, the difference is that if you implement some code that happens to work on your machine when you tested it, you will have to *find* that code, remember what is was supposed to do 20 years later, and figure out *why* it doesn't work anymore and then reimplement it and its side effects. This assumes that you even know that it broke and don't find out when it crashes or gives wrong results at the worst possible time. On the flip side, pthreads is a documented standard that will be provided by your vendor or system supplier. Test suites exist to make sure the implementation really does provide the guarantees it's supposed to. DS .