In message "[ruby-talk:9750] Threads and I/O"
    on 01/01/23, "Hal E. Fulton" <hal9000 / hypermetrics.com> writes:

|Is there any way for the main thread to kill a thread
|that is doing, e.g., a gets?
|
|Crude example below.

require 'timeout'

str = nil
begin
  timeout(5) do
    str = gets
  end
rescue TimeoutError
  ... you have timeout ...
end

							matz.