Subj : Re: STL Containers w/ Virtually Zero-Overhead Lock-Free Reads... To : (Usenet) From : David Abrahams Date : Sat Sep 24 2005 05:17 pm Torsten Robitzki writes: > Chris Thomasson wrote: > >>>are you claiming that it is possible to write a portable, >>>"zero-overhead", lock-free version of all the STL containers ? >> >> >> Yes. There is only one issue... > > 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. > > 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. That's quite a bit too strong. The STL Container interface makes them useless **as shared data structures** in a threaded environment **unless you use external locks**. -- Dave Abrahams Boost Consulting www.boost-consulting.com [ See http://www.gotw.ca/resources/clcm.htm for info about ] [ comp.lang.c++.moderated. First time posters: Do this! ] .