From: Logan Capaldo Date: 2006-12-18T11:33:38+09:00 Subject: Re: Question regarding threads and I/O On Mon, Dec 18, 2006 at 10:40:05AM +0900, Michael W. Ryder wrote: > Maybe I am missing something here but it doesn't seem to work for me. I > have the following simple program: > > require 'timeout' > foo = nil > status = Timeout::timeout(5) { > foo = gets() > } > puts (foo) > > If I enter something, say 123, then the program displays the 123 as > expected. If I just wait it sits there until I enter something which is > not what I want. I want the input to terminate and display that foo is > 'nil'. For some reason testing the value of status shows that it is the > same as the input, but this may not be relevant to the problem. It works for me (well actually timeout throws an exception when the time runs out, doesn't just baort gracefully, but that's what it's supposed to do.) What platform are you on?