Connecting Tech Pros Worldwide Help | Site Map

process monitoring in Py

  #1  
Old October 5th, 2008, 07:55 AM
Newbie
 
Join Date: Oct 2008
Posts: 1
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
  #2  
Old November 7th, 2008, 10:27 PM
Newbie
 
Join Date: Oct 2008
Location: Earth
Posts: 29

re: process monitoring in Py


You could multithread your application.
Reply


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to make python socket server work with the app.MainLoop() in wxpython? zxo102 answers 9 August 8th, 2006 03:25 PM
python-dev Summary for 2006-04-01 through 2006-04-15 Steven Bethard answers 0 June 7th, 2006 05:25 AM
Profiling/performance monitoring in win32 Russell Warren answers 0 February 17th, 2006 05:15 PM
Can you introduce some book about python? fdsl ysnh answers 3 July 19th, 2005 02:29 AM