Subj : Re: STL Containers w/ Virtually Zero-Overhead Lock-Free Reads... To : (Usenet) From : Maciej Sobczak Date : Tue Sep 20 2005 09:03 pm David Abrahams wrote: >>>Perhaps I should create a demo virtually >>>zero-overhead container class... >> >>Please do, it would be a perfect feasibility study. >> >>But be careful to implement the existing interface exactly and >>completely, especially the guarantees about iterators lifetime and >>validity - this will be needed to actually apply some algorithms to it. > > I could be missing something important, but it seems to me that if you > want to "actually apply some algorithms to it" then a lock-free > container is of little use, since you get synchronization at the wrong > level of granularity. That's exactly the point. STL containers do not exist in a vacuum, but are part of something bigger (well, STL) and their design is part of this bigger picture. Implementing the STL containers using some lock-free techniques (the goal of original poster) may force the implementer to drive the design somewhere else - just to show the advantages of lock-free programming - meaning that it will not be STL any longer. Having said that, the implementation of STL that I'm using is lock-free in the sense that there are no locks at all. Why improve it? ;-) But more seriously, I admit that I have no idea what the original poster *really* meant by lock-free STL containers, but anything that is constructive will be for sure of service to the community. -- Maciej Sobczak : http://www.msobczak.com/ Programming : http://www.msobczak.com/prog/ [ See http://www.gotw.ca/resources/clcm.htm for info about ] [ comp.lang.c++.moderated. First time posters: Do this! ] .