Subj : Re: STL Containers w/ Virtually Zero-Overhead Lock-Free Reads... To : (Usenet) From : Chris Thomasson Date : Sat Sep 24 2005 10:34 pm > I wonder how a sequence like > > your::vector v(/* filled some how */); > > if ( !v.empty() ) > { > v.first(); > } > > could be implemented without a lock, and without a lock external to the > container. An external lock would be completely fine and compatible with my algorithm; the method I am using provides the ability for STL-Containters to achieve lock-free read-only iteration. This means that any "critical-sequences" of operations that need to executed atomically are allowed to use various forms of use mutual exclusion, including mutexs... > Lock-Free or Not Lock Free, I think that STL-Containers have a interface > that is quit useless for beeing used in a threaded eviroment. Yeah. Your example demonstrates this. Luckily, STL-Containers are not useless for high-performance lock-free read-only iterations... [ See http://www.gotw.ca/resources/clcm.htm for info about ] [ comp.lang.c++.moderated. First time posters: Do this! ] .