From: Luis Lavena Date: 2008-07-09T16:06:13+09:00 Subject: Re: Threads: Different behavior under Linux and Windows On Jul 8, 5:19 pm, Jochen Theodorou wrote: > ara.t.howard schrieb: > > > On Jul 8, 2008, at 8:26 AM, Armin Armbruster wrote: > > >> Can anybody please explain this to me and more importantly show me a > >> solution on how to do this so it works under Windows as well? > > > it's well known - on windows *all* threads are blocked when the   > > process is blocked on IO. > > that sure is not because of windows itself... so is there a page > explaining why this is so? > No, is not a Windows problem but MRI Ruby Implementation Issue. Ruby Threads are actually Green Threads (not real threads) so the interpreter need to loop in them to be able to process them. When IO is performed in the same thread (since 1.8 is single threaded) it blocks and stop the green threads to be processed. This is quite old actually, and been discussed several times here and ruby-core (search for Io Thread and gets). There was some changes introduced after p114 (1.8.6) but they needed to be reverted because they introduced some issues on MinGW compilation and Drb, which halt the tests (you can also look for that in ruby-core) At this time there is no solution for it, except to avoid that scenario or jump to something like EventMachine to perform that task (search for EventMachine Console in this forum). HTH, -- Luis Lavena