Re: Making C++/STL containers thread-safe
- From: Rupert Kittinger <rkit@xxxxxx>
- Date: Thu, 15 Jun 2006 21:51:26 +0200
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
.
- Follow-Ups:
- Re: Making C++/STL containers thread-safe
- From: Joe Seigh
- Re: Making C++/STL containers thread-safe
- References:
- Making C++/STL containers thread-safe
- From: Dilip
- Re: Making C++/STL containers thread-safe
- From: davids
- Re: Making C++/STL containers thread-safe
- From: Dilip
- Making C++/STL containers thread-safe
- Prev by Date: Re: Making C++/STL containers thread-safe
- Next by Date: Re: Making C++/STL containers thread-safe
- Previous by thread: Re: Making C++/STL containers thread-safe
- Next by thread: Re: Making C++/STL containers thread-safe
- Index(es):
Relevant Pages
|
Loading