delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/09/03/03:12:35

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
From: jurgen DOT defurne AT philips DOT com
To: cygwin AT cygwin DOT com
Subject: Subprocess fork problem
MIME-Version: 1.0
Message-ID: <OFDD07198D.5545DBE6-ONC1256D96.0024854F-C1256D96.00278EDC@diamond.philips.com>
Date: Wed, 3 Sep 2003 09:10:23 +0200

Hello,

I am trying to write a Perl program which needs to execute some
processes (builds) in parallel. This program is started in the following
process hierarchy :

- A running cygwin background process, which starts
  - The main build control process, still cygwin, which starts
   - nmake

Through setting the variable PARALLEL, the targets which have to
be built are changed, and for a PARALLEL build, a new cygwin
script is started, but this time through the command shell, using
ftype and assoc, instead of through cygwin.

This script needs to fork some parallel processes, waits for
one to terminate (waitpid(-1, &WNOHANG), then starts another
one, and so on, until the complete batch of process is done.

These parallel processes should redirect their stdout and stderr
to a logfile, so I do

    open(STDOUT, ">", $logfile);

When I do not do the redirect, all is well. When I do redirect the
standard files I get the following error(s) :

    679 [proc] perl 1972 wait_subproc: wait failed. nchildren 1, wait 
1000, Win32 error 6
    729 [proc] perl 1972 wait_subproc: nchildren 1, event[1] 0x104, 
pchildren[0] 0xCB0000, events[0] 0x20, Win32 error 6
  18491 [proc] perl 1972 wait_subproc: pid 2564, dwProcessId 696, hProcess 
0x104, progname 'c:\cygwin\bin\sleep.exe'

For the moment, the machine which has the problem, still runs on
cygwin 1.3.20, I am waiting for 1.5 to stabilise before I completely
replace all my packages on a production machine.

Anybody have a clue ? Could it be that this problem is solved in a later 
release ?

Regards,

Jurgen



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019