2

I get the following error when I try to open the 65th child process in windows: open3: IO::Pipe: Can't spawn-NOWAIT: Resource temporarily unavailable

How do I open more than 64 child processes on windows using IPC::Open3 in perl?

The following code works fine in linux but fails with the above error on windows:

use POSIX qw[ :sys_wait_h ];;
use IPC::Open3;
use Carp;
use FileHandle;


my $i = 0;

while ($i < 300){
    my($IN)  = new FileHandle;
    my($OUT) = new FileHandle;    
    my($ERR) = new FileHandle;

    $IN->autoflush(1);
    $ERR->autoflush(1);

    my($childpid) = IPC::Open3::open3($IN, $OUT, $_ERR, "<xyz process>")  or 
                    Carp::confess("/n=====$i=======/nCould not open pipe");

    waitpid( $childpid, &WNOHANG);

    $ASPELL_IN->close();
    $ASPELL_OUT->close();
    kill(0,$childpid);
}
brian d foy
  • 129,424
  • 31
  • 207
  • 592
NmN
  • 31
  • 2
  • Does https://stackoverflow.com/questions/17472389/how-to-increase-the-maximum-number-of-child-processes-that-can-be-spawned-by-a-w help? – brian d foy Jun 18 '20 at 13:53

0 Answers0