> > > BTW, I think the writer would actually need to bump the > counter twice, > > once before and once after it modifies its stats area. > Else there's > > no way to detect that you've copied a partially-updated stats entry. > > Actually, neither of these ideas works: it's possible that > the reader copies the entry between the two increments of the > counter. Then, it won't see any reason to re-read, but > nonetheless it has copied an inconsistent partially-modified entry. > > Anyone know a variant of this that really works? >
Here's a theory: If the counter is bumped to an odd number before modification, and an even number after it's done, then the reader will know it needs to re-read if the counter is an odd number. This might be assuming too much about what the writer knows about the current contents of the counter, but since it's per-back end, I think it would work. Regards, Paul Bort ---------------------------(end of broadcast)--------------------------- TIP 2: Don't 'kill -9' the postmaster