Subj : Re: STL Containers w/ Virtually Zero-Overhead Lock-Free Reads... To : (Usenet) From : Chris Thomasson Date : Wed Sep 21 2005 08:57 am > If you're asking about lock free read access while someone else > is modifying, and only the modifier having a lock, I'm > sceptical. When you get some time, go ahead and study some of the RCU literature. Basically, readers can observe "and access" objects that have been removed; memory is tracked by the collector... > A modifying access can generally rearrange memory, > changing the addresses of objects, etc. Which in turn > invalidates results from read accesses, even in a single thread > environment. You would not generally directly modify the object that a node was representing in a collection, unless the "reader algorithm" you use has the proper logic to handle and detect updates. There are several methods you can use. For instance, you could use a mutex to pop the node, then send it through the collector. When it comes out on the other side you are guaranteed that no other threads hold any references to it. You then modify and push it back into the collection. You could also use monotonic counters; like some ABA solutions, ect, ect... [ See http://www.gotw.ca/resources/clcm.htm for info about ] [ comp.lang.c++.moderated. First time posters: Do this! ] .