[Dovecot] Dovecot waking every 50ms when doing nothing
Timo Sirainen
tss at iki.fi
Sun Jun 3 18:27:35 EEST 2007
On Sun, 2007-06-03 at 18:13 +0300, Timo Sirainen wrote:
> Maybe the optimal solution would be to create a new abstraction layer.
> Most of the timeout handlers are just checking for idle timeouts.
>
> struct idle_timeout *idle_timeout_new(unsigned int secs,
> timeout_callback_t *callback, void *context);
> void idle_timeout_free(struct idle_timeout *idle);
> void idle_timeout_reset(struct idle_timeout *idle);
>
> The code would internally keep just one timeout handler and whenever
> it's called, calculate the new time when it should be called.
..Or maybe just fix the basic timeout_*() API. Add a new timeout_reset()
call == timeout_remove() + timeout_add(original values) and then make
the implementation be fast with hundreds of timeouts. The timeouts are
currently kept in linked list, so that could be changed to red-black
tree I guess (sorted by next execution time). Or is there a better data
structure for this?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://dovecot.org/pipermail/dovecot/attachments/20070603/4b1dc268/attachment.bin
More information about the dovecot
mailing list