Terminating threaded programs

Stephen Hansen apt.shansen at gmail.com
Mon Feb 8 21:16:04 EST 2010


On Fri, Feb 5, 2010 at 7:25 AM, mk <mrkafk at gmail.com> wrote:

> Hello everyone,
>
> I have a problem with a threaded program: it frequently hangs on sys.exit.
>

I use threads all the time (well, for certain types of workloads) and have
never seen this.

Are your threads daemon threads? The only time I've seen sys.exit() not
close out my program is when I'm launching non-daemon threads on accident.

Now, I do get some slightly random errors on close due to threads doing
stuff or returning from doing stuff while the shutdown procedure is going
on, but I don't really care, cuz, well, I'm shutting everything down and
nothing worth knowing is going on in the rest of the program.

--S
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20100208/354b3600/attachment-0001.html>


More information about the Python-list mailing list