From: Bryan Richardson Date: 2008-08-13T07:34:31+09:00 Subject: Re: Non-Threaded Timeout? Hi Bill, Thanks for the reply. I hate Windows. :) I did a few tests (all-be-it I came up with the tests, so that might be the problem) and it does seem like IO.popen is blocking... IO.popen "ruby -e 'sleep(20); STDERR.puts \"Popped!\"'" sleep(10) puts "Hello" sleep(15) puts "Hi" Output was: Popped! Hello Hi I CAN'T CATCH A BREAK ANYWHERE!!!! Argh... this is why I don't develop on Windows! :( On Tue, Aug 12, 2008 at 3:07 PM, Bill Kelly wrote: > I'm just jumping into the middle of the thread, so apologies if > I've missed something; but ... > > popen blocks ALL ruby threads on windows. This has been the bane > of my existence for the past eight years. :) > > The problem is due to Microsoft's venerable design strategy: You are > lost in a twisty little maze of API's, all incompatible. > > On Windows, the "file handle" returned by popen is not a "socket", > and therefore is incompatible with "select". > > /me raises a cup of hemlock in toast to Redmond > > > Note: Now that 1.9 ruby uses native threads, it should be possible > to implement a nonblocking popen. However, last time I tested 1.9 > for this behavior, it still blocked. (This was several months ago.) > > > Regards, > > Bill > > > >