Subj : Re: Lock-free buffer To : comp.programming.threads From : David Schwartz Date : Sat Mar 05 2005 02:39 pm "SenderX" wrote in message news:loWdndvDk4vcuLffRVn-pw@comcast.com... >> 1) Allocate a new buffer. >> >> 2) Write the data into the buffer. >> >> 3) Save the pointer to the buffer that the readers use. >> >> 4) Atomically replace the pointer with the pointer to the new buffer. >> >> 5) Set a timer to free the old buffer later. > > How would the timer know how long to wait? There are several techniques and it depends upon the application. One way is to wait until all threads that could have used the buffer pass a neutral point. DS .