Re: I need some help with POE::Wheel::Run on Windows

2009-10-02 Thread Andrew Feren

Hi all,

If it helps anyone the original discussion about adding the 
Win32::Console::_SetStdHandle() and related changes can be found here 
http://markmail.org/message/js5sold5cjpybdfw#query:broeren%20poe+page:1+mid:x7rqurekgiojuhxn+state:results.  
It seems pretty clear that a lot effort went into trying to get the 
original patch right.


I'd really love understand why this code is needed (on not).  So far all 
of my tests have performed identically (other than the leak) with or 
without the _SetStdHandle() calls.


-Andrew

Rocco Caputo wrote:
First, thanks to Andrew Feren, POE::Wheel::Run::Win32 has been merged 
into POE::Wheel::Run.


Andrew has also reported a memory leak POE::Wheel::Run under Windows: 
https://rt.cpan.org/Ticket/Display.html?id=50068


My problem is that I don't know Win32 APIs well enough to say whether 
his patch does any harm.  He's bypassing 
Win32::Console::_SetStdHandle() calls that set STDIN, STDOUT and 
STDERR to the pipes that communicate with the parent process.  It 
seems like reasonable code, but I don't know any better.


Any help would be appreciated.

Thank you.



Re: I need some help with POE::Wheel::Run on Windows

2009-10-02 Thread Olivier Mengué
2009/10/2 Rocco Caputo rcap...@pobox.com

 First, thanks to Andrew Feren, POE::Wheel::Run::Win32 has been merged into
 POE::Wheel::Run.


Great news !

I'm using POE::Wheel::Run::Win32 with my patch for bug #43995
https://rt.cpan.org/Ticket/Display.html?id=43995

Looks like you applied the patch. Fine!



 Andrew has also reported a memory leak POE::Wheel::Run under Windows:
 https://rt.cpan.org/Ticket/Display.html?id=50068


My problem is that I don't know Win32 APIs well enough to say whether his
 patch does any harm.  He's bypassing Win32::Console::_SetStdHandle() calls
 that set STDIN, STDOUT and STDERR to the pipes that communicate with the
 parent process.  It seems like reasonable code, but I don't know any better.


This part of the code is the most obscure to me and I've still not figured
out why it is required. The comments in the code are not enough for me to
understand.


 Any help would be appreciated.


Win32::Job-spawn() has options : stdin, stdout; stderr. Maybe a path to
explore?

Olivier.
http://search.cpan.org/~dolmen/ http://search.cpan.org/%7Edolmen/


Re: I need some help with POE::Wheel::Run on Windows

2009-10-02 Thread Rocco Caputo

Thanks for pointing that out.  I had forgotten the backstory on it.

It strongly implies that the I/O redirection must be done BEFORE the  
fork() call on Windows, as it seems that fork() communicates stdio to  
exec() inside Perl.  Time for test cases...


--
Rocco Caputo - rcap...@pobox.com


On Oct 2, 2009, at 09:12, Andrew Feren wrote:


Hi all,

If it helps anyone the original discussion about adding the  
Win32::Console::_SetStdHandle() and related changes can be found  
here.  It seems pretty clear that a lot effort went into trying to  
get the original patch right.


I'd really love understand why this code is needed (on not).  So far  
all of my tests have performed identically (other than the leak)  
with or without the _SetStdHandle() calls.


-Andrew

Rocco Caputo wrote:


First, thanks to Andrew Feren, POE::Wheel::Run::Win32 has been  
merged into POE::Wheel::Run.


Andrew has also reported a memory leak POE::Wheel::Run under  
Windows: https://rt.cpan.org/Ticket/Display.html?id=50068


My problem is that I don't know Win32 APIs well enough to say  
whether his patch does any harm.  He's bypassing  
Win32::Console::_SetStdHandle() calls that set STDIN, STDOUT and  
STDERR to the pipes that communicate with the parent process.  It  
seems like reasonable code, but I don't know any better.


Any help would be appreciated.

Thank you.