Subj : Re: Concurrent write undefined? To : comp.programming.threads From : David Schwartz Date : Mon May 23 2005 08:28 pm "doug" wrote in message news:Grtke.116959$Cq2.101565@fe2.news.blueyonder.co.uk... >> You have completely undefined behavior. > Off the topic for this particular post, but: > is this 'undefined behaviour' for the same reason as the 'thread owner > check without memory barrier is not safe' discussion we're having below? > i.e. that reads/writes to the variable may not be atomic? Or is there > something else too/instead? Who knows? Read and writes might not be atomic. Things might be cached somewhere. Speculative fetches might occur. You never know, in general, what the hardware might do, since in principle, you don't know what the hardware is. You have precisely the guarantees the standard gives you. DS .