Subj : Re: Memory synchronization with pthreads To : comp.programming.threads From : Chris Vine Date : Sun Jan 16 2005 11:30 pm Joseph Seigh wrote: > On Sun, 16 Jan 2005 22:01:36 +0000, Chris Vine > wrote: [snip] >> fork() is one of the functions required to synchronize memory. >> Presumably that must synchronize memory for all threads in the process in >> which one of the threads has fork()ed (otherwise it is difficult to see >> what the standard thinks it requires on a fork)? > > AFAIK, it doesn't. [snip] > The phrase "synchronize memory" isn't defined in Posix pthreads. You need > to learn more about memory models and memory consistency and how it's > accomplished before you attempt to do memory synchronization outside of > the > standard thread design patterns and paradigms. You should learn what > memory > barriers are and how to use them. Also why context switching from a > syscall or thread switch needs to synchronize memory. This has been quite enlightening. What do you think the standard in fact requires when it stipulates that memory must be synchronized between threads on a fork() call? From what you say, it seems sufficiently nebulous as to be meaningless (and with respect to other standards would be regarded as a defect). Chris -- To reply by e-mail, remove the "--nospam--" in the address .