LPD-EPFL / CLHT

CLHT is a very fast and scalable (lock-based and lock-free) concurrent hash table with cache-line sized buckets.
http://lpd.epfl.ch/site/ascylib
Other
146 stars 21 forks source link

using clht while meet some memory problem #12

Open xzwj1699 opened 2 years ago

xzwj1699 commented 2 years ago

hello, I've meet some problem while using clht

at first, I chose the clht_lb_res in my application, and then I got a core dump caused by ht_resize().

then I changed to clht_lb, and init the hashtable like clht_create(5000), and then I got a checksum mismatch(this comes from an asseet in my own application ), so I print all the item in the hashtable(I used it like int --> char*).

and the problem is the char is all right, but the content char point to is changed.

I'am sure that it's clht's problem because after I changed the hashtable to SPTAG(another hashtable implementation), the problem disappeared

so i guess that there may be some hidden bugs in the ssmem part of your program。it maybe implicitly change the contents of the memory, or conflicts with the memory management of my application

trigonak commented 2 years ago

Hello,

Interesting. clht_lb with no resize does not use the ssmem, since there is no need to garbage collect buckets (see https://github.com/LPD-EPFL/CLHT/blob/master/src/clht_lb.c).

Some invariants that CLHT has are:

Otherwise, I do no see how CLHT could rewrite the pointed by the char * memory. For CHLT, these are "just" values and w/o resizing, they are never copied or migrated.