Connecting Tech Pros Worldwide Help | Site Map

process monitoring in Py

Newbie
 
Join Date: Oct 2008
Posts: 1
#1: Oct 5 '08
Hi,
I am working with a test harness and I need to monitor a process. If the process isn't done in a specific alloted time, I need to abort the process. The code goes something like this...

startTime = time.clock()
App.ActiveProject.ActiveProcessor.Run(True) # This will start the process
while(ProcessorState != HALT):
endTime = time.clock()
elapsedTime = endTime - startTime
if(elpsedTime > 900): # abort the process if it takes more than 15 minutes
App.Stop
break
else:
continue

The problem I am facing is that once the comand in line # 2 is executed, the process starts and the interpreter will not go to the line # 3 untill line # 2 execution is completed which makes the rest of the monitoring code useless.
Appreciate any ideas of going around this problem as I new to Py.

Thanks,
SN
Newbie
 
Join Date: Oct 2008
Location: Earth
Posts: 29
#2: Nov 7 '08

re: process monitoring in Py


You could multithread your application.
Reply