No, you only recompile your application. The kernel get passed the
number of bits in the set. If you've hard coded limits into the
kernel, that's a seperate issue.
> 2) every time poll(2) or select(2) returns, you may get dozens of
> descriptors which are ready. How do you solve this? Call
> find_first_zero_bit for each active descriptor (clearing as you go)?
Why not? It's still a hell of a lot faster than the silly code you
have below. The vast majority of the time, only a handfull of the bits
are going to be set.
> I've appended my latest version test programme. Compile with -O2. This
> contains a *realistic* scanning loop. It takes 1.5 milliseconds on a
> Pentium 100.
Congratulations. You managed to time a naive scan through a large
array.
This is one of the reasons you use select(). It means you can scan a
bit array very fast.