| Store | Cart

RE: Win32::Process::Create Questions

From: Greene, Adam S <adam...@intel.com>
Tue, 26 Mar 2002 12:44:44 -0800
1. Call the wait method on your process object

Create your process and get the PID
	Win32::Process::Create ($process, $program, $commandline, $inherit,
$flags, $dir);
	$pid = $process->GetProcessID();

Create a loop and check for the process to finish
	if( $process->Wait(1)) {
		print "Process is done\n";
	}
	else{
		print "Process is running as $pid\n";
	}

2. The name of the process in the task manager will be the program that is
being called in $program. If you specify 'c:/perl/bin/perl.exe', you will
see a lot of perl.exe in your process list.

3. Not sure on that one...can have specified timeout limits that you Wait()
for and kill if it doesn't end. Not sure how the other methods respond when
a process gets into that state.


Win32::Process works pretty well. I created a script that will process a
list of servers and spawn a script against each of them (or against a subset
of the total list), up to a maximum number of concurrent processes. The
script ensures that there are always the max number of processes running as
long as there are more servers to process. Makes it easy to throttle and is
faster than serially processing the servers. 

Adam Greene 
Intel Corporation
adam...@intel.com 





-----Original Message-----
From: rAuL [mailto:l...@speakeasy.net]
Sent: Tuesday, March 26, 2002 12:00 PM
To: perl...@listserv.ActiveState.com;
perl...@listserv.ActiveState.com
Subject: Win32::Process::Create Questions



1) If I create a background process using Win32::Process::Create, how do I
determine it is still running?  

2) When I create this process, what name does it take if I look under NT
Task Manager?

3) How can I also determine if this process is in "Not Responding" state?

Thanks Again
Raul
_______________________________________________
Perl-Win32-Admin mailing list
Perl...@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Recent Messages in this Thread
Greene, Adam S Mar 26, 2002 08:44 pm
rAuL Mar 27, 2002 03:08 pm
Messages in this thread