title: How to safely iterate an interlocked slist?
body: <p>We have data that is shared between threads stored in a interlocked singly linked list.<br>
  <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms684121(v=vs.85).aspx" rel="nofollow">https://msdn.microsoft.com/en-us/library/windows/desktop/ms684121(v=vs.85).aspx</a></p>
  
  <p>We know the list does not change after initialization but we would like the various threads to be able to iterate and read the contents of the list.  Is there an safe way to  read/iterate over an slist? </p>
  
  <p>The current code takes the nodes OUT of the list with InterlockedFlushSList, then makes a temp copy of the data and then puts the nodes back into the slist.  If the slist is shared between threads, seems like a race condition just waiting to happen.   </p>
  
  <p>Without just going to a different thread safe structure is a there a safe way to read iterate slist?</p>