Subj : Re: double-checked locking in C To : comp.programming.threads From : Peter Dimov Date : Sat Jul 09 2005 06:37 pm Alexander Terekhov wrote: > What I'm saying is that "real-world events" regarding accesses > to volatile objects of standard storage duration (not some > external stuff; and sig_atomic_t and longjmp() aside for a > moment) are nonexistent. > > http://groups.google.de/group/comp.std.c/msg/43b15005632c8040 "In the abstract machine, all expressions are evaluated as specified by the semantics. An actual implementation need not evaluate part of an expression if it can deduce that its value is not used and that no needed side effects are produced (including any caused by calling a function or accessing a volatile object)." In my opinion, this means that if no side effects are produced, the expression may be left unevaluated. Your example produces three side effects (two writes and one access) and can't be left unevaluated. One might argue that these side effects aren't "needed", of course. ;-) .