New "timeout" api, to replace callout

M. Warner Losh imp at bsdimp.com
Sun Dec 2 07:48:01 PST 2007


In message: <15391.1196547545 at critter.freebsd.dk>
            Poul-Henning Kamp <phk at phk.freebsd.dk> writes:
: Here is my proposed new timeout API for 8.x.
: 
: The primary objective is to make it possible to have multiple timeout
: "providers" of possibly different kind, so that we can have per-cpu
: or per-net-stack timeout handing.
: 
: A secondary goal, is to shove the anti-race handling in destruction of
: timeouts back into the implemenation, rather than force users to spend
: 20+ lines doing that.
: 
: A third goal is to enable deadline scheduling of timeouts using hardware
: like HPET when and where we have it.
: 
: Comments in general (only B/W) and pointers to client code of
: particular interest is most welcome.

>>/*
>> * 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"
implementation.

Right now we have a well defined unit (1/hz).  I worry that without
having a way to convert time to this thing that we'll have more
trouble writing drivers.

Warner


More information about the freebsd-arch mailing list