efficient / libcuckoo

A high-performance, concurrent hash table
Other
1.62k stars 275 forks source link

upsert reentrancy? #127

Closed graehl closed 4 years ago

graehl commented 4 years ago

Just a question: if the constructor (or update fn) for a value causes another modification to the cuckoohash_map (say it's global), will corruption or deadlock ensue, or will the two or more insert/update both succeed?

manugoyal commented 4 years ago

Hey @graehl! Unfortunately we make no guarantees about mutating the hashtable within a callback or item constructor. The operation is performed under a non-reentrant spinlock, so if a hashtable operation called within the callback needs to access the same lock, it will never complete.

graehl commented 4 years ago

Thanks, I figured in absence of guarantee that was the case.

On Wed, Jul 1, 2020 at 7:30 PM Manu Goyal notifications@github.com wrote:

Hey @graehl https://github.com/graehl! Unfortunately we make no guarantees about mutating the hashtable within a callback or item constructor. The operation is performed under a non-reentrant spinlock, so if a hashtable operation called within the callback needs to access the same lock, it will never complete.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/efficient/libcuckoo/issues/127#issuecomment-652743396, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAYFUCHPUVI4SC5DE2YPIDRZPWKZANCNFSM4OOCYSWA .