From: Bjorn Stahl Date: 2003-01-20T04:37:50+09:00 Subject: Strange sleep behavior? th = Thread.new{ print "Going to sleep for 5 seconds\n" sleep(5) print "Going to sleep for infinity\n" sleep(0) print "awake, did someone wake me up?\n" } key = STDIN.getc th.run ----------------------------------------------- will give: Going to sleep for 5 seconds Going to sleep for infinity awake, did someone wake me up? test.rb:9:in `run': killed thread (ThreadError) from test.rb:9 (with both 1.8.0-preview and 1.6.8) ----------------------------------------------- from the pickaxe book "...An argument of zero causes sleep to sleep forever. " Have I seriously misunderstood this or something more evil is at work here? :-) As far as I can see the thread should not give "awake, did someone wake me up" until after I've pressed a key, but sleep 0 seems to really sleep for 0 seconds instead of until SIGALRM/run.