[mod_python] mod_python and threading.Thread doesn't start

Alexey Melchakov melchakov at gmail.com
Mon Jun 6 03:39:26 EDT 2005


Hi.
I'm using mod_python 3.1.4, apache 2.0.x/prefork and python2.4.
The following code doesn't work:

from mod_python import apache
import threading

def something():
open('/tmp/thread', 'w').close()

def handler(req):
threading.Thread(target=something).start()
return apache.OK

Browser request successfully hits the handler(), and no errors occure, but 
something() is not called (no file on filesystem after request).

If I insert logging statements after thread initialization and a call of 
start() thread object looks like this:
<Thread(Thread-1, initial)>
<Thread(Thread-1, started)>

I'm not good with threading and this might be very ordinary situation, dont 
really know. Please help.

-- 
melchakov at gmail.com
CRV-RIPN
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mm_cfg_has_not_been_edited_to_set_host_domains/pipermail/mod_python/attachments/20050606/c63afaaa/attachment.html


More information about the Mod_python mailing list