From: Kero van Gelder Date: 2003-08-03T05:22:14+09:00 Subject: Re: 1.8.0-previewX rb_sys_fail() on socket instead of an Exception. > Aha, I understand. If I move clearerr() before rb_sys_fail(), will it > solve the problem? > > matz. > --- io.c 1 Aug 2003 07:23:00 -0000 1.227 > +++ io.c 2 Aug 2003 17:59:02 -0000 > @@ -910,5 +910,5 @@ appendline(fptr, delim, strp) > if (ferror(f)) { > + clearerr(f); > if (!rb_io_wait_readable(fileno(f))) > rb_sys_fail(fptr->path); > - clearerr(f); > continue; Interestingly, the program now never stops with printing 'nil' (as if the Thread is never switched; the second loop in server.rb (with socket.puts in it) isn't processed anymore). Even if I put a small sleep directly after gets, and the CPU usage drops from 100% to negligible, the second loop is not scheduled anymore. Thanks, Kero.