473,320 Members | 1,982 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

process monitoring in Py

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
Oct 5 '08 #1
1 1356
Fabez
29
You could multithread your application.
Nov 7 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Ralf Gross | last post by:
Hi, I'm monitoring a RedHat Enterprise 4 server with a DB2 8.2 database. Last week I added some processes which should be checked, to the net-snmp config. db2fmcd db2fmp db2dasrrm db2fmd
12
by: Raymond Lewallen | last post by:
How to wait for a process to stop completion is my goal. Obviously, the looping while waiting for the HasExited property is not a solution.. but thats the best I can come up off the top of my...
2
by: Mike Fellows | last post by:
Hi, If i start a process using System.Diagnostics.Process.Start(myprog.exe, myattributes) is it possible to monitor that process from code so that i know when it has completed/closed? Thanks...
0
by: bamapookie | last post by:
I've written an app that starts and monitors a number of processes. If one of those processes dies, the app restarts it. One of the options I've written hides the main window of the monitored...
0
by: bamapookie | last post by:
I've written an app that starts and monitors a number of processes. If one of those processes dies, the app restarts it. One of the options I've written hides the main window of the monitored...
0
by: bamapookie | last post by:
I'm sorry if this was posted several times. I did not see my previous post appear after I posted it. I've written an app that starts and monitors a number of processes. If one of those...
0
by: Filipe Marcelino | last post by:
Hi, I whant to know if a user is using a process. To achieve that I have to know the state of the process, so I wrote the following code: Dim localAll As Process() =...
6
by: Laser Lu | last post by:
Thanks for looking at this post:) Does anyone knows how to make the asp.net process runs in the UserInteractive mode? I just want to show some Windows Forms in my asp.net application on the...
4
by: Paddy | last post by:
We have a recurring problem where a (long-running) service throws an exception while trying to access a file. The problem is that this is very rare (happens once every week and without warning) but...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.