In message <>, "M. Warner Losh" writes
>In message: <>
> Poul-Henning Kamp writes:

>>> * A duration of time, represented in the optimal way for a given provider
>>> * or family of providers (ie: per cpu).
>>> */
>>>typedef int timeout_time;

>What does this mean? How do I get one of those? Without a unit
>associated with this number, it becomes hard to do a "tickless"

You get it back from the timeout provider. The point here is that
most timeout clients use the same time interval again and again,
so precalculating any "magic" values for the specific hardware makes

In practice your code could look like:

struct foo_softc {

timeout_time timeout_duration;


foo_attach() {

sc->timeout_duration = timeout_conv_time([...], 200, TIMEOUT_MSEC);

foo_something() {

timeout_arm(sc->timeout, sc->timeout_duration, [flags]);


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.
_______________________________________________ mailing list
To unsubscribe, send any mail to ""