Daemonic threads

David S. I at DONT.LIKE.SPAM
Tue Nov 16 03:53:51 CET 1999


I'm writing a CGI script that will launch a long-running process in the
background, and return some HTML page to the browser.  Now, I know how
to do that with 'fork()', but it seems to me that I should be able to do
the same thing with a daemonic thread from the 'threading' module.

I can't get that to work, though,

	...
	xt = threading.Thread(target=_threadExec, args=(save, mail, None))
	xt.setDaemon(1)
	xt.start()
	...

and the script exits with no thread running.  Non-daemonic threads seem
to work as I expect them to.  What don't I understand about daemonic
threads?  (Python 1.5.2 on Linux 2.2.7, if its relevant.)

David S.
davids@
...	bdgp.org




More information about the Python-list mailing list