title: Performing a pointer swap in a double-buffer multithread system
body: <p>When double-buffering data that's due to be shared between threads, I've used a system where one thread reads from one buffer, one thread reads from the other buffer and reads from the first buffer. The trouble is, how am I going to implement the pointer swap? Do I need to use a critical section? There's no Interlocked function available that will actually swap values. I can't have thread one reading from buffer one, then start reading from buffer two, in the middle of reading, that would be appcrash, even if the other thread didn't then begin writing to it.</p>
  
  <p>I'm using native C++ on Windows in Visual Studio Ultimate 2010 RC.</p>