From: Robert Klemme Date: 2011-03-02T19:54:58+09:00 Subject: Re: question: threads behaviour On Tue, Mar 1, 2011 at 11:13 PM, Eric Wong wrote: > Robert Klemme wrote: >> On 03/01/2011 08:16 PM, Eric Wong wrote: >>> Robert Klemme  wrote: >>>>> 1.8 will schedule other threads if the blocking IO is for a socket/pipe >>>>> and uses the normal Ruby IO interfaces (or the extension author was >>>>> careful).  Filesystem I/O (including NFS) can block the entire process >>>>> in 1.8. >>>> >>>> Where do you take that from?  AFAIK internally Ruby 1.8.* uses non >>>> blocking IO calls in combination with select() to be able to let other >>>> threads work while IO is under way. >>> >>> Yes, I meant "blocking" from a user-visible perspective, not from a >>> kernel perspective.  If there's an EAGAIN it'll block the current thread >>> from a user perspective and schedule others using select(), but not >>> actually block on the syscall that caused EAGAIN. >> >> OK, but earlier you said that file system IO can block the entire >> process - which is not exactly true and also does not match what you >> said now. :-) > > Filesystem IO (regular files) doesn't return EAGAIN (at least not on > systems I'm familiar with). http://www.kernel.org/doc/man-pages/online/pages/man2/read.2.html#ERRORS robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/