Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 17 Oct 95 15:23 PDT
From:      jdp@polstra.com (John Polstra)
To:        terry@lambert.org
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: getdtablesize() broken?
Message-ID:  <m0t5KPw-000077C@seattle.polstra.com>
In-Reply-To: <199510172123.OAA28400@phaeton.artisoft.com>

next in thread | previous in thread | raw e-mail | index | archive | help
> > > 10ms is the argument resoloution.  On Solaris, it's 10ms, while select()
> > > is till 4uS.  select() wins.  8-).
> > 
> > Why do you say "10ms is the argument resoloution"?  The man pages
> > explicitly say that the timeout is specified in milliseconds.  Simple
> > tests indicate that the man pages are accurate.  What is the basis for
> > your claim?
> 
> The SVR4.2 man pages.  You are reading the Sun man pages.  Stop it.  8-).

Even worse -- I was reading the SVR4.0 man pages.  [Hangs head in shame.]

But isn't the 10ms resolution just an artifact of a particular
implementation?  The timeout is still specified in milliseconds, isn't
it?  Surely they didn't change that!?  (I'm genuinely asking, as I don't
know the answer.)  A poll implementation in FreeBSD could support a
resolution of 1ms, that's my point.

Given what you wrote next, I agree that this is moot anyway:

> 1ms is too low a resolution in any case.  I have apps that need 200uS;
> Colorado Memory systems has one that needs ~100uS (or a buzz loop).

OK, well, if people really need that kind of resolution then I can't
argue with that.  In that case you're certainly right that poll isn't up
to the task.

> > You're confusing me.  First you say that poll is no good because it
> > doesn't support simple timed waits.  Then somebody points out that you
> > were wrong, and poll does in fact support that.  So then you say that
> > polls which work that way are broken.
> > 
> > Poll is broken, because it fails to exhibit the broken behavior which you
> > originally claimed it had?  Have I got this right?
> 
> 
> No, poll is no good because it doesn't support *sufficient resoloution*
> on simple timed waits.

I completely misinterpreted your earlier remarks.  Sorry.

> In addition, the select(2) call in BSD reserves the right to modify the
> timeval structure to indicate the remaining time to allow the use of
> the timeout as an even outcall mechanism for logical multithreading.

Yes.  I wish more implementations of select actually did that.

-- John

   John Polstra                                       jdp@polstra.com
   Polstra & Co., Inc.                        Seattle, Washington USA
   "Self-knowledge is always bad news."                 -- John Barth



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