Leon wrote:
I hope the OpenSSL maintainers heard this cry (even if it is a small
cry) and will at some point decide to use a better method than select.

This got patched in CVS yesterday for Linux.


David Schwartz wrote:
        A patch to use 'poll' instead of 'select' where it's available would be 
a
very good idea. Using 'select' to check readiness of a single descriptor
that you just opened is about the worst-case scenario for 'select' (because
it has to scan through all the unset bits on each set). Using 'poll' is far
more efficient for a single descriptor since no scanning is needed.

The performance of finding the first set bit from a 128byte block of data really isn't that bad inside the kernel. Faster than a strcpy() of a 128byte string I'd say, as there is no memory writing going on. Its also probably still in CPU the cache as your just did FD_ZERO()/FD_SET() on it.

A number of CPUs support assembly instructions to facilitate it and operate on 32bit/64bit slices. How would file system free block bitmaps get on is there was something really bad about it.

linux/include/asm-i386/bitops.h: find_first_bit() uses i386 BSF.

Its probably not used in the kernel for the select() syscall as its converted to poll() and I guess for most general usage of select on many fds there are more bits set than not set in the range provided.

Darryl
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to