Subj : Re: STL Containers w/ Virtually Zero-Overhead Lock-Free Reads... To : (Usenet) From : Joe Seigh Date : Tue Sep 20 2005 10:04 pm David Abrahams wrote: > Maciej Sobczak writes: > > >>Chris Thomasson 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. You'd need algorithm-level synchronization, > rather than container-level synchronization, in that case. In other > words, the SGI argument against putting mutexes in the containers > applies just as well to the question of whether lock-free container > operations are a good idea. > It's not like putting synchronization wrappers around an existing STL container. It involves different implememntations and possibly subtle or not so subtle semantic differences, particularly in the area of iterators and handling of "temporary" raw references. I think this lack of transparancy and the lack of experience in this area will be the cause of some amount of shock if and when lock-free containers show up. Putting on my pointy ears, I'd estimate the probability of lock-free containers being adopted as quite low. Low enough that I've stopped doing any serious work with developing new lock-free techniques and mechanisms. -- Joe Seigh When you get lemons, you make lemonade. When you get hardware, you make software. [ See http://www.gotw.ca/resources/clcm.htm for info about ] [ comp.lang.c++.moderated. First time posters: Do this! ] .