Hi (back on the list),

I have a program that needs IO#read to be fast. I found out that IO#read
uses C's getc() instead of fread(). This is several times slower than
fread(), as I tried it. However, I think my solution would not work with
Ruby threads. Is there a way to use fread() to get sensible amounts of
data without fear of blocking?

If there is a problem with READ_DATA_PENDING, then another way Ruby IO
could work is by permanently setting the non-blocking flag on all open
filehandles, and then fake the rest to Ruby programs.

What do you think?

________________________________________________________________
Mathieu Bouchard                       http://artengine.ca/matju