-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
clht_lf_res.c hash table have collision detection? #4
Comments
|
if i need save struct key{char url[128]}, struct value{char url[128],int exist} into clht_lb_link hash table, the type of clht_addr_t is uintptr_t , i use murmur hash function calculate struct key{char url[128]} get a key value , and then i call clht_put(clht_t* h, clht_addr_t key, clht_val_t val) into hash table, if key value is the same but the url is not same, clht_lb_link cannot insert the second value by clht_lb_link's code. As far as I know, hashtable should have the most basic collision handling。i use clht in multithreads situation,some threads put value into hashtables,and some threads will iteration hashtables and maybe modify values(struct value{char url[128],int exist} the exist value), because the url is not same but the key maybe the same, i need insert hashtable both. |
Currently, as you mentioned, CLHT supports 8-byte keys. You would need to slightly modify CLHT to use larger keys. The approach is similar to the way you already use CLHT, however, you need to make the key comparison in two steps:
To be able to do this comparison, you need to store all three: Let me know if you will try to create this version yourself. Otherwise, whenever I find some time, I can create a first draft version for you. |
i read some clht_lf_res.c code, i cannot found some collision code, if key value that hash function calculate is the same .
The text was updated successfully, but these errors were encountered: