On 2012-Jul-10 10:03:08 -0500, Paul Albrecht <albre...@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

Attachment: pgpaFY3z3IfaV.pgp
Description: PGP signature

Reply via email to