public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Bill Rugolsky Jr." <brugolsky@telemetry-investments.com>
To: Jamie Lokier <jamie@shareable.org>
Cc: Mark Mielke <mark@mark.mielke.cc>,
	Davide Libenzi <davidel@xmailserver.org>,
	Lennert Buytenhek <buytenh@math.leidenuniv.nl>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: bug in select() (was Re: {sys_,/dev/}epoll waiting timeout)
Date: Mon, 27 Jan 2003 16:27:17 -0500	[thread overview]
Message-ID: <20030127162717.A1283@ti19> (raw)
In-Reply-To: <20030123221858.GA8581@bjl1.asuk.net>; from jamie@shareable.org on Thu, Jan 23, 2003 at 10:18:58PM +0000

On Thu, Jan 23, 2003 at 10:18:58PM +0000, Jamie Lokier wrote:
> If, as someone said, the appropriate unix specification says that
> "wait for 10ms" means to wait for _at minimum_ 10ms, then you do need
> the +1.
> 
> (Davide), IMHO epoll should decide whether it means "at minimum" (in
> which case the +1 is a requirement), or it means "at maximum" (in
> which case rounding up is wrong).
> 
> The current method of rounding up and then effectively down means that
> you get an unpredictable mixture of both.

Quite independent of this discussion, my boss came across this today
while looking at some strace output:

   gettimeofday({1043689947, 402580}, NULL) = 0
   select(4, [0], [], [], {1, 999658})     = 0 (Timeout)
   gettimeofday({1043689949, 401857}, NULL) = 0
   gettimeofday({1043689949, 401939}, NULL) = 0
   select(4, [0], [], [], {0, 299})        = 0 (Timeout)
   gettimeofday({1043689949, 403577}, NULL) = 0

Note that 1043689949.401857 - 1043689947.402580 = 1.999277.

The Single Unix Specification (v2 and v3), says of select():

   Implementations may also place limitations on the granularity of
   timeout intervals. If the requested timeout interval requires a finer
   granularity than the implementation supports, the actual timeout
   interval shall be rounded up to the next supported value.

That seems to indicate that a fix is required.

Regards,

   Bill Rugolsky

  parent reply	other threads:[~2003-01-27 21:18 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-22  6:55 {sys_,/dev/}epoll waiting timeout Lennert Buytenhek
2003-01-22  8:03 ` Jamie Lokier
2003-01-22 12:46   ` Ed Tomlinson
2003-01-22 13:20     ` Jamie Lokier
2003-01-22 19:14       ` Randy.Dunlap
2003-01-22 19:34         ` Jamie Lokier
2003-01-22 19:32           ` Randy.Dunlap
2003-01-23 14:07   ` Davide Libenzi
2003-01-23 15:43     ` Jamie Lokier
2003-01-23 17:27       ` Mark Mielke
2003-01-23 18:28         ` Jamie Lokier
2003-01-23 20:40           ` Mark Mielke
2003-01-23 22:18             ` Jamie Lokier
2003-01-24 14:41               ` Andreas Schwab
2003-01-25  1:08               ` Davide Libenzi
2003-01-27 21:27               ` Bill Rugolsky Jr. [this message]
2003-01-27 22:52                 ` bug in select() (was Re: {sys_,/dev/}epoll waiting timeout) Davide Libenzi
2003-01-28  9:45                   ` Jamie Lokier
2003-01-28 10:52                     ` Mark Mielke
2003-01-28 21:39                       ` Jamie Lokier
2003-01-28 22:15                     ` Davide Libenzi
2003-01-28 19:42   ` {sys_,/dev/}epoll waiting timeout Randy.Dunlap
2003-01-28 21:36     ` Jamie Lokier
2003-01-28 21:44       ` David Mosberger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030127162717.A1283@ti19 \
    --to=brugolsky@telemetry-investments.com \
    --cc=buytenh@math.leidenuniv.nl \
    --cc=davidel@xmailserver.org \
    --cc=jamie@shareable.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark@mark.mielke.cc \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox