Re: a proposed callout API



In message <20061113133236.A28926@xxxxxxxxxxxxxx>, Luigi Rizzo writes:
On Mon, Nov 13, 2006 at 08:53:41PM +0000, Poul-Henning Kamp wrote:


i am a bit curious on why you want to split the callouts among
multiple data structures.

A binary heap is optimal for the timeouts that will happen, but
filling it up with timeouts that are unlikely to, and in most
cases won't happen for a very long time will soak up CPU
time used for pointlessly ordering the heap.

Also, many of the "non-happening" timeouts are repeatedly
rescheduled, the TCP keepalives for instance, having a data structure
where this is free of cost is a big advantage.

The other thing is that covering the entire range from hour long
callouts to nanosecond callouts would require a 64 bit value or
a tricky pseudo-FP encoding. By splitting them in two classes,
I can use two different 31 bit encodings separated by the top bit.

--
Poul-Henning Kamp | UNIX since Zilog Zeus 3.20
phk@xxxxxxxxxxx | TCP/IP since RFC 956
FreeBSD committer | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
_______________________________________________
freebsd-arch@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-arch
To unsubscribe, send any mail to "freebsd-arch-unsubscribe@xxxxxxxxxxx"