[mod_python] off topic: thread handling

marinus van aswegen mvanaswegen at gmail.com
Fri Aug 11 04:46:53 EDT 2006

Hi All

This is slightly off topic, I have a program that supports my
mod_python app that spawns
x nr of threads to go and fetch data from a remote site using urllib2,
rather than doing it from the mod_python req. If there's a comms
problem I tell the thread to sleep. In the past this worked I have
reworked the code a bit so that a comms problem now raise an
exception. The sleep now happes in the exception code block. It
appears that when a thread has raised an exception and the sleep is
invoked that all the threads get stuck. I'm using standard threads and
I'm not locking my calls just yet.


More information about the Mod_python mailing list