Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 27 Dec 1999 12:46:03 -0800 (PST)
From:      jasone@FreeBSD.ORG
To:        mi@aldan.algebra.com, jasone@FreeBSD.ORG, freebsd-bugs@FreeBSD.ORG
Subject:   Re: kern/13644
Message-ID:  <19991227204603.A28DF14BB7@hub.freebsd.org>

next in thread | raw e-mail | index | archive | help
Synopsis: select(2) timer inaccurate, especially with -pthread

State-Changed-From-To: open->closed
State-Changed-By: jasone
State-Changed-When: Mon Dec 27 12:39:03 PST 1999
State-Changed-Why: 
The kernel implementation of sleep() uses tvtohz() to calculate the
number of ticks that tsleep() should sleep.  tvtohz() adds one tick to
allow for the possibility that the current tick is almost expired.     
select() guarantees that it will sleep at least as long as the timeout 
before returning an empty result (0).  If the number of ticks passed to
tsleep() were reduced by one, this guarantee would no longer be possible.
 
This is not a bug; it is an artifact of correct implementation.  If you
need higher resolution, use nanosleep().


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19991227204603.A28DF14BB7>