lkml.org 
[lkml]   [2000]   [Jan]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] Polling > 16000 FDs
Hi,

> > err = -EINVAL;
> > if (nfds > current->files->max_fds)
> > goto out;
>
[ numerous problems with this approach ]

So replace it with the current user's maximum, multiply by two (for those
who want to use different slots for read and write), and add a small
fudge factor. If you really need it.

Personally, though, I think that it's not very sensible to always use
poll(a_whole_lot) even if you've got only two files open, and it's even
less sensible to use different slots for read and write. Using the current
maximum instead isn't exactly rocket science to code, and sharing the
read and the write side in one slot isn't either.

Personally, I wouldn't let programs written with that kind of "let's eat
kernel performance on each poll() instead of adding five cheap lines of
code when the pollfd[] is set up" mindset near my system anyway if I can
at all help it. :-/

--
Matthias Urlichs | noris network GmbH | smurf@noris.de | ICQ: 20193661
The quote was selected randomly. Really. | http://www.noris.de/~smurf/
--
A time would come when Men should be able to stretch out their Eyes ...
they should see the Planets like our Earth.
-- Christopher Wren

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

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