Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Python

Generating a thread dump from python

 

 

Python python RSS feed   Index | Next | Previous | View Threaded


csterry at mail

Sep 12, 2001, 11:26 AM

Post #1 of 1 (287 views)
Permalink
Generating a thread dump from python

I am using a python script to run a java command.
When the java command hangs, I would like to issue a 'kill -3' to the java.
Anybody know how this can be done?

The following is happening in a thread in my python script:
--------- snip -----------
def run( self ) :
outFile = os.popen('java com.foo.bar.class')

logFile = open( logFileName )

# Read the output as it comes in.
while 1 :
s = outFile.readline()
if not s : break
logFile.write(s)
logFile.flush()

if self.timedOut.isSet() :
logFile.close()
outFile.close()
raise SystemExit

logfile.close()
returnCode = outFile.close()

Python python RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.