> -----Original Message-----
> From: Lilijun (Jerry) <jerry.lili...@huawei.com>
> Sent: Tuesday, May 12, 2020 6:28 PM
> To: Wang, Yipeng1 <yipeng1.w...@intel.com>; Honnappa Nagarahalli
> <honnappa.nagaraha...@arm.com>; 'dev@dpdk.org' <dev@dpdk.org>
> Cc: wangyunjian <wangyunj...@huawei.com>; xudingke
> <xudin...@huawei.com>; 'sta...@dpdk.org' <sta...@dpdk.org>; nd
> <n...@arm.com>; nd <n...@arm.com>
> 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?

Reply via email to