Date: Wed, 11 Jul 2012 17:50:45 +1000 From: Peter Jeremy <peter@rulingia.com> To: Paul Albrecht <albrecht@glccom.com> Cc: freebsd-hackers@freebsd.org Subject: Re: kqueue timer timeout period Message-ID: <20120711075044.GA10224@server.rulingia.com> In-Reply-To: <1341932588.6997.6.camel@albrecht-desktop> References: <1341932588.6997.6.camel@albrecht-desktop>
next in thread | previous in thread | raw e-mail | index | archive | help
--7JfCtLOvnd9MIVvH Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2012-Jul-10 10:03:08 -0500, Paul Albrecht <albrecht@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. --=20 Peter Jeremy --7JfCtLOvnd9MIVvH Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAk/9MFQACgkQ/opHv/APuIcVHwCgjd94NxaR1o1bJvKuZWPx9rMe 6ZQAoI/xS6s6NFGtbFLYmtfWjkDK79ml =quLt -----END PGP SIGNATURE----- --7JfCtLOvnd9MIVvH--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120711075044.GA10224>