[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: deadlock in ThreadPool using backtick

alexd

8/9/2007 3:23:00 PM

Justin Johnson wrote on 09/08/2007 15:05:36:

> > It still seems to me that stdout and stderr have something to do with
my
> > problem, since it always occurs when using backticks or even
> > win32/popen3 methods that read from stdout and stderr, but never with
> > system. Anyone else have any ideas on this?
>
> I should also point out that the exact same script never fails on UNIX.
> Maybe this is a Windows bug? :-(

AFAIK Windows Ruby threads do not work properly when used in conjunction
with external I/O. I think this is something to do with the Ruby and
Windows select loops.

HTH


Alex.

1 Answer

Sam Smoot

8/9/2007 4:09:00 PM

0

On Aug 9, 10:23 am, al...@nominet.org.uk wrote:
> Justin Johnson wrote on 09/08/2007 15:05:36:
>
>
>
> > > It still seems to me that stdout and stderr have something to do with
> my
> > > problem, since it always occurs when using backticks or even
> > > win32/popen3 methods that read from stdout and stderr, but never with
> > > system. Anyone else have any ideas on this?
>
> > I should also point out that the exact same script never fails on UNIX.
> > Maybe this is a Windows bug? :-(
>
> AFAIK Windows Ruby threads do not work properly when used in conjunction
> with external I/O. I think this is something to do with the Ruby and
> Windows select loops.
>
> HTH
>
> Alex.

Ditto. AFAIK all external IO is blocking in Ruby on Windows. Which is
why
the green threads are next to useless on Windows. You can't even use
DRb
to get around it with multiple distinct processes since they'll all
block
until the remote execution returns.