lkml.org 
[lkml]   [2003]   [Jan]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: {sys_,/dev/}epoll waiting timeout
Randy.Dunlap wrote:
> | > Why assume HZ=1000? Would not:
> | >
> | > timeout = (unsigned long)(timeout*HZ+(HZ-1))/HZ+1;
> | >
> | > make more sense?
> |
> | No, that's silly. Why do you want to multiply by HZ and then divide by HZ?
>
> OK, I don't get it. All Ed did was replace 1000 with HZ and
> 999 with (HZ-1). What's bad about that? Seems to me like
> the right thing to do. Much more portable.
>
> What if HZ changes? Who's going to audit the kernel for changes?

You're being dense. The input timeout is measured in milliseconds;
see poll(2). The calculated timeout is measured in jiffies. Hence
multiply by jiffies and divide by milliseconds.

-- 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.050 / U:3.544 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site