From: Rik Hemsley Date: 2001-11-05T18:38:47+09:00 Subject: [ruby-talk:24379] Problem with readline and select The following program takes ~6s to complete when using readline in the main thread. It takes ~0s to complete when using sleep. Some kind of clash between readline and IO.pipe/select ? Ruby from CVS, checked out a couple of days ago. Rik ===============================8<================================= require 'readline' $rd, $wr = IO.pipe t = Time.now Thread.new do 1.upto(20) do select([$rd]) $rd.read(100) end $stderr.print "Time taken: ", (Time.now - t).to_s, "\n" exit 0 end Thread.new do buf = "a" * 100 loop do $wr.write(buf) end end if ARGV[0] == 'rl' Readline.readline("> ", true) else sleep 10 end ===============================>8=================================