Subj : Re: STL Containers w/ Virtually Zero-Overhead Lock-Free Reads... To : (Usenet) From : Chris Thomasson Date : Wed Sep 21 2005 06:13 am >> 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 IMHO, this is the most important issue of all. I know virtually zero-overhead STL is possible; however, there are a couple of subtitle “features” that come along with “state-of-the-art solutions” to the classic reader/writer problem. Unfortunately, these “features” are not very forgiving wrt algorithms that incorporate object membership in a particular collection into their standard logic. Basically, objects can legitimately exist in a collection “after other threads” have atomically removed them. It is safe, and “normal” for iterating threads to access a “recently removed” object, simply because the objects memory is being meticulously managed by the “collector”. >> Would anybody be interested in such a thing? > > Certainly. Okay. I thought that there might be a little interest. I am currently polishing a proof-of-concept library right now. However, I am very busy incorporating it parts of it into some in-house server software. I will have the time to provide the demo library in the near future (most likely before next year). Humm... Perhaps a “new collection and iteration model” should be created, and the STL could stay the same. Something like std::fast_map< ... > ect. I believe something has to be done in C++ that can address the high-performance computers that are becoming available to everyday customers... Thank you for your comments. P.S. When I use the term “features”, I am referring to an inherent side-effect that is common to algorithms that allow writes, and memory barrier / atomic operation free reads to execute in parallel. This type of behavior is key to scalability wrt SMP, NUMA, ect... BTW, there is an odd “solution” to the iteration problem; however, I am really not allowed to post any information. ;(... [ See http://www.gotw.ca/resources/clcm.htm for info about ] [ comp.lang.c++.moderated. First time posters: Do this! ] .