lkml.org 
[lkml]   [2003]   [Jan]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: bug in select() (was Re: {sys_,/dev/}epoll waiting timeout)
Mark Mielke wrote:
> On Tue, Jan 28, 2003 at 09:45:00AM +0000, Jamie Lokier wrote:
> > Davide Libenzi wrote:
> > > ( if Tms > 0 )
> > Which is unfortunate, because that doesn't allow for a value of Tms ==
> > 0 which is needed when you want to sleep and wake up on every jiffie
> > on systems where HZ >= 1000. Tms == 0 is taken already, to mean do
> > not wait at all.
>
> To some degree, isn't this the equivalent of yield()?

No. If you want a process to wake every HZ tick, do a little work and
then sleep again, yield() won't do that.

If HZ >= 1000, you simply can't use Linux poll() to do that; you have
to use select(). (Or epoll_wait()).

Even if select() is changed to do double-rounding-up like poll(), it
will still do this because select() times have microsecond
granularity.

-- Jamie

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:32    [W:0.067 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site