Thread (10 messages) 10 messages, 5 authors, 2018-08-07

Re: [PATCH] hash table: add a bucket iterator function

From: Michel Machado <hidden>
Date: 2018-08-07 13:24:42

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help