jeffthewookiee has asked for the wisdom of the Perl Monks concerning the following question:
This is being run on Windows Server 2003. Is there a way in the Windows world to do a non-blocking waitpid() call or equivalent?sub check_for_completed_processes { my @completed; my @temp; # print "Checking for completed procs...\n"; while(my $running = pop @running) { if(waitpid($running -> {process_id} ,&WNOHANG)) { $running -> {end_time} = timestamp(); # print "Finished. \n"; push @completed, $running; print "Process completed: " . $running -> {process} . "\n"; print "Started at: " . $running -> {start_time} . "\n"; print "End time: " . $running -> {end_time} . "\n"; } else { push @temp, $running; } } @running = @temp; return @completed; + }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: waitpid and Windows
by BrowserUk (Patriarch) on May 31, 2007 at 19:50 UTC | |
by jeffthewookiee (Sexton) on Jun 02, 2007 at 11:59 UTC | |
by syphilis (Archbishop) on Jun 03, 2007 at 07:26 UTC | |
by BrowserUk (Patriarch) on Jun 02, 2007 at 16:48 UTC | |
|
Re: waitpid and Windows ($])
by tye (Sage) on Jun 01, 2007 at 00:32 UTC | |
by jeffthewookiee (Sexton) on Jun 02, 2007 at 12:05 UTC |