Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Looking at that quickly, I don't see a problem - that should work. Although you're doubling the size of the hash table itself.

You can even do (atomic) refcounting to make sure that everyone is done using the old chain before resizing, although this may slow things down. (So the hash table contains a field of two integers, which indicate the number of readers currently traversing index 0 and 1. Once the value of the "old" index reaches 0, you know it is safe to resize again.)

And you should be able to extend this to k versions easily, which would mean that (k-2) slow readers won't inhibit resizing.

Although, all of that being said, I don't really see the advantage of this over a coocoo hash table.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: