a proposed callout API

Poul-Henning Kamp phk at phk.freebsd.dk
Mon Nov 13 21:47:35 UTC 2006


In message <4558E5B3.1000003 at freebsd.org>, Colin Percival writes:
>Poul-Henning Kamp wrote:
>> XXX_arm(struct xxx*, tick_t, func *, arg *, int flag, struct mtx *);
>> 	Arm timer.
>
>If we (meaning you) are going to redesign the callout code, I think it
>would be great if the API provided some mechanism for specifying the
>required callback accuracy; for example "I'd like to be called back no
>later than 3 seconds from now, but any time after 2 seconds would be
>fine".

I thought about something like that, but I fear that the extra
math will soak up any advantage there might be for short callouts.

For long timeouts, there could be some merit to the argument, if
we didn't have tons of short timeouts happening all the time
to begin with.

But do notice that I plan to run the "slow" callouts only twice
per second (to minimize rounding errors).  That could actually
be a sysctl, so that one could increase the granularity of
their execution if so desired.

I have added a facility that points the other way:  You can get
a window in which you should expect your (short) callout to happen.

-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.


More information about the freebsd-arch mailing list