[dpdk-dev] [PATCH] hash table: add a bucket iterator function
Michel Machado
michel at digirati.com.br
Tue Aug 7 15:24:32 CEST 2018
On 08/03/2018 11:24 AM, Stephen Hemminger wrote:
> Often for time based cleanup it is better to have a second linked list that is ordered
> by time value. Then the cleanup code can start at the oldest stop when it reaches
> the last item that could expire.
>
> That does mean having some form of lock and doing delete/insert on every usage.
>
> i.e
> spinlock(&timer_lock);
> TAILQ_REMOVE(&timer_list, entry, timer_list);
> entry->expiration = new time;
> TAILQ_INSERT_TAIL(&timer_list, entry, timer_list);
> spinunlock(&timer_unlock);
We'll try it. Thanks for the suggestion, Stephen.
[ ]'s
Michel Machado
More information about the dev
mailing list