Subj : Memory visibility and synchronization using pipes To : comp.programming.threads From : Marcin 'Qrczak' Kowalczyk Date : Sat Jan 15 2005 12:10 pm Let's say thread A does this: - changes a variable - writes to a pipe and thread B does this: - waits until poll() says the pipe can be read - accesses the variable (the pipe is used only for this synchronization). Is it safe, or the change to the variable may not be seen by the other thread? I guess write() and poll() are not memory barriers and this is unsafe. If so, how to fix it in the simplest way? I'm using a pipe because thread B uses poll() on other descriptors at the same time. -- __("< Marcin Kowalczyk \__/ qrczak@knm.org.pl ^^ http://qrnik.knm.org.pl/~qrczak/ .