Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 Nov 2006 21:45:34 +0000
From:      "Poul-Henning Kamp" <phk@phk.freebsd.dk>
To:        Colin Percival <cperciva@freebsd.org>
Cc:        arch@freebsd.org
Subject:   Re: a proposed callout API 
Message-ID:  <7378.1163454334@critter.freebsd.dk>
In-Reply-To: Your message of "Mon, 13 Nov 2006 13:37:55 PST." <4558E5B3.1000003@freebsd.org> 

next in thread | previous in thread | raw e-mail | index | archive | help
In message <4558E5B3.1000003@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@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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?7378.1163454334>