Connecting Tech Pros Worldwide Help | Site Map

process monitoring in Py

 
LinkBack Thread Tools Search this Thread
  #1  
Old October 5th, 2008, 06:55 AM
Newbie
 
Join Date: Oct 2008
Posts: 1
Default process monitoring in Py

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
Reply
  #2  
Old November 7th, 2008, 09:27 PM
Newbie
 
Join Date: Oct 2008
Location: Earth
Posts: 29
Default

You could multithread your application.
Reply
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search


Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.