in reply to Re: Win32 fork() "problem"
in thread Win32 fork() "problem"

Hi, dawn

I've looked at those modules already and will probably end up utilising Win32::Job on an XP box at some point. This has the benefit of easily being able to set a timeout for a command using $job->run($cmd,$timeout) which is a huge improvement for Win32 platforms.

I was really hoping I had made a glaring logic error (rather than fork() just playing up) in my use of fork...

If I can't get a simple case like this to work (does this work on another platform?) I'll have to resort to a more brute force method of divvying up work. :-(

Replies are listed 'Best First'.
Re: Re: Re: Win32 fork() "problem"
by tilly (Archbishop) on Mar 27, 2004 at 08:49 UTC
    FYI, your code works fine on Linux. Here is the output:
    Parent 962 got PID 963 from fork(962 Computer1) 963 Computer1 +Parent 962 got PID 964 from fork(962 Computer2) 964 Computer2 + 965 Computer3 Parent 962 got PID 965 from fork(962 Computer3) +Parent 962 got PID 966 from fork(962 ) 966 +wait() ed until -1 was returned.
    Another module that you might look into is IPC::Run. I know that it has at least some Win32 functionality.