From: Robert Klemme Date: 2003-05-07T22:38:13+09:00 Subject: IO.pipe + thread = hangs (was: Re: capture output) While experimenting a bit I discovered that this script hangs in the line that puts "start" (version 1.6.7 on win and linux): rd, wr = IO.pipe reader = Thread.new do buffer = "" puts __LINE__ rd.each do |line| puts __LINE__ buffer << line end buffer end # last line printed: puts __LINE__ wr.puts "start" puts __LINE__ wr.flush wr.close puts __LINE__ puts "read: <<#{reader.value}>>" puts __LINE__ Any ideas why? robert