Re: Making C++/STL containers thread-safe



Dilip schrieb:
davids@xxxxxxxxxxxxx wrote:
Dilip wrote:
I'm surprised nobody mentioned the standard trick for this case.


David

That sounds really interesting. (taken with that caveat from Chris)

No matter what I try in my current implementation I am constantly hurt
by the need to lock the map whenever anyone wants to do a look up. We
have only one mega uber-map that stores everything. Maybe I can use
similiar algorithm and split it into maybe a dozen maps... The problem
with the hashing approach I don't know how to generate even
distribution... my map can literally contain a couple of _million_
entries! Collisions will then become the norm :-(


Have you already considered using a database to hold the data? E.g. PostgreSQL is freely available and can handle concurrent read and write
requests. If you have enough RAM that the whole table can be kept in memory, performance may be good enough for you.

just a thought...

Rupert
.



Relevant Pages

  • Re: Making C++/STL containers thread-safe
    ... (taken with that caveat from Chris) ... No matter what I try in my current implementation I am constantly hurt ... by the need to lock the map whenever anyone wants to do a look up. ...
    (comp.programming.threads)
  • Re: Liskov Substitution Principle and Abstract Factories
    ... Because it wasn't clear if X and Y map from the same S. ... >> individual dogs instead. ... > it's no matter, if you choose it to be of no matter. ... Real.Get_Value but constructing a composition: ...
    (comp.object)
  • Re: infinity
    ... This is provably true no matter what X is, ... > fail to map any element of X to w. ... >> and derive a contradiction from assuming any natural mapping to ... How many significant bits do your naturals ...
    (sci.math)
  • Re: Vineland
    ... >>I don't know that the parchment is 17th century. ... >>It doesn't matter what the burden of Seppo's post was, ... >>am unclouding the issue by arguing that the map lacks proper ... The above posting is neither a legal opinion nor legal advice, ...
    (sci.archaeology)
  • Re: Problem using IF to create ranges
    ... I am making a Map with MS Map in excel 2000. ... >Hi Chris ... Create a lookup table on a spearate sheet/range. ...
    (microsoft.public.excel.worksheet.functions)

Loading