Subj : Re: Memory visibility and synchronization using pipes To : comp.programming.threads From : Alexander Terekhov Date : Sat Jan 15 2005 04:34 pm Marcin 'Qrczak' Kowalczyk wrote: [...] > Is it safe, or the change to the variable may not be seen by the other It is "unsafe". You have a data race. Undefined behavior. > thread? I guess write() and poll() are not memory barriers and this is > unsafe. Even if they do have memory barriers internally, compiler is not constrained and can reorder you accesses across write() and poll(). They both are standard functions and they are NOT listed in the XBD 4.10. > If so, how to fix it in the simplest way? Use something from the XBD 4.10 to get rid of data race. regards, alexander. .