>> So this is not correct?
Haven't analyzed it since it was first published, but coming from Herb Sutter it's probably safe to assume that it's correct (at least against the C++0x draft that was available at the time).
>> or did I misunderstand something?
C++ volatile isn't even mentioned in that article. atomic<T> from the upcoming C++0x is used to guarantee ordering and memory consistency among threads. Not really related to Posix C.
More good reading from Herb:
Dr. Dobb's | Lock-Free Code: A False Sense of Security | September 8, 2008
Dr. Dobb's | volatile vs. volatile | January 8, 2009
>> The lock on the front end is really gonna slow me down...
You don't know this without profiling a working MT-Q, under load.
Writing correct, wait-free, data structures is extremely difficult in a language like C or C++03 which doesn't define a memory model for the "abstract machine". It would require assembly language and a knowledge of the architecture you're writing for. Even with a well defined memory model, correctness is difficult.
If on Windows, then assembly language isn't necessarily required, thanks to the Interlocked API's - but correctness is still just as difficult. Which is why there's Interlocked SList as well.
gg