kqueue timer timeout period

Peter Jeremy peter at rulingia.com
Wed Jul 11 07:50:54 UTC 2012


On 2012-Jul-10 10:03:08 -0500, Paul Albrecht <albrecht at glccom.com> wrote:
>I have a question about the kqueue timer timeout period ... what's data
>supposed to be? I thought it was supposed to be the period in
>milliseconds, but I seem to off by one.
>
>For example, if I set date (the timeout period) to 20 milliseconds, I
>often wait 21 milliseconds which is very undesirable for my application.

FreeBSD is not a real-time OS.  The timeouts specified in various
syscalls (eg kevent(EVFILT_TIMER), nanosleep(), select(), poll())
specify minimum timeouts.  Once the timeout (rounded up to the next
tick) has expired, the process will be placed back into the queue
of processes eligible to be run by the scheduler - which may impose
a further arbitrary delay.

Periodic timers are somewhat better behaved:  Scheduler delays only
impact process scheduling after the timeout expires and the average
rate should be very close to that requested.

-- 
Peter Jeremy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20120711/8221226f/attachment.pgp


More information about the freebsd-hackers mailing list