I've already linked to this in passing , but I'm going to rerun it as an explicit link. Threads Cannot be Implemented as a Library by Hans Boehm makes the argument in its title:
We provide specific arguments that a pure library approach, in which the compiler is designed independently of threading issues, cannot guarantee correctness of the resulting code.
There is also a discussion of this paper at Lambda the Ultimate that may be interesting reading. On a quick skim of the LtU discussion thread, this Usenet article jumps out as a useful summary of the entire
volatile
and multiprocessor programming issue, ending up with the conclusion that using
volatile
is both unnecessary and harmful in shared-state concurrent programming.