From: "Francis Cianfrocca" <garbagecat10 / gmail.com>
> 
> What am I missing here?
> 
> require 'socket'
> require 'fcntl'
> Thread.new {sleep 100}
> sd = TCPsocket.new( "www.cisco.com", 80)
> m = sd.fcntl( Fcntl::F_GETFL, 0)
> sd.fcntl( Fcntl::F_SETFL, Fcntl::O_NONBLOCK | m)
> sd.sysread(4096)
> 
> This code blocks in the sysread, in effect ignoring the nonblocking mode set
> on the file descriptor. But if you comment out the line that spins the
> thread, the sysread raises Errno::EAGAIN as you'd expect.
> 
> Is this a defined behavior or a bug?

Hi, I learned about this just the other day.  See thread
starting here:

http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/192008


Regards,

Bill