[EMAIL PROTECTED] wrote:

> An update:
> 
> I need to run a couple processes (or threads) in parallel, and when one of 
> them ends (which one ends first will vary), kill the other and continue the 
> main program. I was hoping to use a signal handler to catch a SIGCHLD to 
> notify me when the first child ends so I don't have to keep polling them 
> both. But since the forked child in Perl on Windows apparently does not send 
> a SIGCHLD when it ends, that method seems to be out.
> 
> If I use Win32::Process to create the children, I can't use Wait(). Wait() 
> blocks, so I can only wait for one of the children and I don't know which one 
> to wait for. So I think the only option left is to loop and check for the 
> continued existence of each process every second or so. I don't think that 
> should take too much CPU time (any experience with that?), but it's clearly 
> not as elegant as simply waiting for notification by the OS via a signal when 
> the child dies.

You can use 'threads::shared' to share a vrbl or use a semaphore or
mutex (Win32::Semaphore Win32::Mutex) to handle your thread control.

-- 
  ,-/-  __      _  _         $Bill Luebkert    Mailto:[EMAIL PROTECTED]
 (_/   /  )    // //       DBE Collectibles    Mailto:[EMAIL PROTECTED]
  / ) /--<  o // //      Castle of Medieval Myth & Magic http://www.todbe.com/
-/-' /___/_<_</_</_    http://dbecoll.tripod.com/ (My Perl/Lakers stuff)
_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to