Hi,

At Sun, 4 Aug 2002 09:55:35 +0900,
Mathieu Bouchard wrote:
> 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?

I know, see 1.7.

> 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.

We just had discussion about non-blocking IO in ruby-dev last
week.  I thought about it too, but there is an issue.  The flag
is shared by parent and child processes.  At least, bash resets
the flag always after chilren exited, but other programs almost
don't work with it.

LWP library of old SunOS also could be used together with
libnbio, and had same issue.

-- 
Nobu Nakada