News for hackers. Stuff that matters.
Re:How to implement a hash table in C by moistbar on Friday March 26, 2021 @02:57PM (#26595607)
I'm not a particularly good programmer, so I may be missing something here, but I'd think that moving the items should be its own function that happens in between gets and sets, no? Besides adding a decidedly non-read-only operation to what should be read-only, shouldn't the movement happen when you're not trying to do anything with the hash table?
Re:How to implement a hash table in C by jeffffff on Friday March 26, 2021 @03:09PM (#26595733)
typically rehashing is done during insert. if you were going to do it while not doing anything else with the hash table you'd have to use a background thread, and then you'd have to do some form of synchronization, so there would be significant additional complexity and overhead.