From: Bill Kelly Date: 2004-08-25T03:58:26+09:00 Subject: [BUG?] timeout{wait} (was: Re: How safe is 'timeout' ?) Hi again, > I'm experiencing strange behavior in a Ruby app doing > multithreaded I/O, and I seem to have narrowed it down > to my using a timeout { } block around a condition > variable wait. E.g. > > timeout(1.0) { @condition_variable.wait(@mutex) } I have gotten the code down to a couple hundred lines, and am able to reproduce the problem easily on: ruby 1.8.0 (2003-08-04) [i386-mswin32] ruby 1.8.2 (2004-07-29) [i386-mswin32] ruby 1.8.0 (2003-10-24) [i686-linux] My apologies in advance if I turn out to be doing something stupid in my own code. http://bwk.homeip.net/ftp/buffered-io-test3.rb If I comment out line 216 100.times { global_signal.timed_wait(0.003) } and uncomment line 213 instead 100.times { sleep(0.003) } ...I don't experience the problem. But as-is, with line 216 in place, the problem I experience is that the background_write thread will sporradically not awaken, even after being signalled repeatedly. If anyone is able to help confirm that this really is a bug, or, point out that I'm doing something stupid.... I'd really appreciate it. Thanks for your help! Regards, Bill