> -----Original Message----- > From: Lilijun (Jerry) <[email protected]> > Sent: Tuesday, May 12, 2020 6:28 PM > To: Wang, Yipeng1 <[email protected]>; Honnappa Nagarahalli > <[email protected]>; '[email protected]' <[email protected]> > Cc: wangyunjian <[email protected]>; xudingke > <[email protected]>; '[email protected]' <[email protected]>; nd > <[email protected]>; nd <[email protected]> > Subject: 答复: [dpdk-dev] [PATCH] lib/librte_hash: add > rte_hash_del_key_fixed without compact
<...> > > [Yipeng] > > Could you tell me more on the use case? Since insertion would also > > invalidate the Iterator, do you insert keys only to new table during > > resizing? > > > [Lilijun (Jerry)] > Yes, Insert only to new table. Because the resize process need take a write > lock and the old table's key insertion are prevented by the lock now. > Do you mean the key insertion may change other key's position by cuckoo > hash algorithm and invalidate the iterator? > That maybe a new question I haven't met yet. [Wang, Yipeng] For cuckoo algorithm, if the table is relatively full, new inserted key could move other keys around in the table. For example, when I insert A, A could move B to B's alternative bucket to make space for A, that’s where the name "cuckoo" comes from. 😊 So if you insert keys into table, the iterators should be invalidated too. But as you said you only insert keys to new table while you iterate only the old table right?

