From: <Joe...@t-...> - 2017-12-20 18:27:41
|
Hi, Sam wrote: >I may be missing something, but it seems to me that the requirements are >contradictory: >If one thread keeps adding and removing a key, then the other thread may >iterate over the table forever, presenting the same key over and over again. Indeed. However you could add to the front of the list and expect the iterator to already have passed that point. IIRC one can seek inspiration from the RCU lists in the Linux kernel, even though we have nothing to do with RCU. But I was just considering updates to the single linked list within one bucket. Updating the array of buckets concurrently is hairy (what if someone removes the last element in one bucket, wants to resize, etc.) Plain fun. Regards, Jörg |