Thread stops!!

Phil Hornby phil.hornby at accutest.co.uk
Mon Feb 2 08:41:18 EST 2004


Steve,

>> I have a multithreaded python script that collects some data
>> periodically and populates it into a database. For some reason, one of
>> the thread keeps stopping after running for some while and there's no
>> failure or any other sign of failure. What can possibly be going wrong?
>> how can I track this? Is there someway I can find out if ony of the
>> thread stopped? Please help!!

A code snippet might help??

How are you controlling the thread?

If you are doing something periodically is it something like:

class myThread(threading.Thread):

	def run():

		while 1:
			#do something
			self.dosomething()

			sleep(x)

Is your thread stopping or just 'finishing'? i.e. is the run method getting
to the end?

I don't know what environment you are running it in but if you are able to
see the stdout you could add a simple print statement as the last thing in
the function to see if it gets there...if so then the problem is in your
control code, e.g. the events you wait for or the flags you act on.

HTH

--
Phil

"Requirements - what are they I just hack something together that does what
I think they want" ;)





More information about the Python-list mailing list